2017-03-16 8 views
5

से कीबाइंडिंग का उपयोग नहीं कर रहा है। मैं थोड़ी देर के लिए iTerm2 में tmux का उपयोग कर रहा हूं लेकिन मैं tmux एकीकरण का उपयोग नहीं कर रहा हूं जो अब iTerm2 के साथ आता है।Imm2 tmux एकीकरण के साथ .tmux.conf

मैंने tmux एकीकरण का उपयोग करना शुरू कर दिया क्योंकि यह आपको tmux के अंदर खोल एकीकरण का उपयोग करने की अनुमति देता है।

मुझे जिस समस्या का सामना करना पड़ रहा है वह यह है कि tmux -CC मेरे .tmux.conf काम के अंदर कोई भी महत्वपूर्ण बाइंडिंग नहीं है ... मैं काम करने के लिए किसी भी डिफ़ॉल्ट को भी प्राप्त नहीं कर सकता। मैं वास्तव में tmux एकीकरण का उपयोग करना चाहता हूं लेकिन तब तक नहीं कर सकता जब तक कि मैं अपने .tmux.conf में काम करने के लिए कुंजी बाइंडिंग प्राप्त नहीं कर सकता।

कुछ बाइंडिंग जो काम नहीं कर रहे हैं;

  • रिबाउंड C-s
  • bind-key \ split-window -v -c '#{pane_current_path}'
  • bind-key - split-window -h -c '#{pane_current_path}'

को उपसर्ग कुंजी ये सिर्फ उदाहरण के एक जोड़े लेकिन मूल रूप से कुछ भी नहीं लगता है काम करने हैं ...

मेरे .tmux .conf

# improve colors 
set-option -g default-terminal "screen-256color" 

# set base Prefix key to ctrl-s 
unbind C-b 
set -g prefix C-s 
bind-key -r C-s send-prefix 

# reload the source config 
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded" 

# Smart pane switching with awareness of Vim splits. 
# See: https://github.com/christoomey/vim-tmux-navigator 
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ 
    | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" 
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" 
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" 
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" 
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" 
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" 

set-option -g status-keys "emacs" 

#change colour of status bar 
set-option -g status-bg '#666666' 
set-option -g status-fg '#aaaaaa' 

# set window split 
bind-key - split-window -v -c '#{pane_current_path}' 
bind-key \ split-window -h -c '#{pane_current_path}' 

# set text in status bar 
set -g status-interval 1 
set -g status-justify centre # center align window list 
set -g status-left-length 50 
set -g status-right-length 140 
set -g status-left '#[fg=green]#H #[fg=black]• #[fg=green,bright]#(uname -r | cut -c 1-6)#[default]' 
set -g status-right '#[fg=green,bg=default,bright]#(tmux-mem-cpu-load -i 1) #[fg=red,dim,bg=default]#(battery -at) #[fg=white,bg=default]%a%l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d' 

# Fine adjustment (1 or 2 cursor cells per bump) 
bind -n S-Left resize-pane -L 2 
bind -n S-Right resize-pane -R 2 
bind -n S-Down resize-pane -D 1 
bind -n S-Up resize-pane -U 1 

# new window opens in same directory 
bind c new-window -c "#{pane_current_path}" 

# set window numbering to start from 1 
set -g base-index 1 
set -g renumber-windows on 

# allow to take a pane and put it into new window 
bind-key b break-pane -d 

# allows ctrl-j to open tree of tmux sessions 
bind-key C-j choose-tree 

# Use vim keybindings in copy mode 
setw -g mode-keys vi 

# Setup 'v' to begin selection as in Vim 
bind-key -t vi-copy v begin-selection 
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" 

# Update default binding of `Enter` to also use copy-pipe 
unbind -t vi-copy Enter 
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" 

# History 
set -g history-limit 10000 

# Mouse mode 
set-option -g mouse on 

# Rename Tab 
set-option -g set-titles on 

# Terminal notifier doesnt work with tmux 
set -g default-command "which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l $SHELL || $SHELL -l" 

set-option -sg escape-time 10 
+0

[iTerm 2 का संभावित डुप्लिकेट .tmux.conf में घोषित कुंजी बाइंडिंग का सम्मान नहीं करता है] (https://stackoverflow.com/questions/26063195/iterm-2-not-honoring-key-bindings-declared-in-tmux -conf) –

उत्तर

1

से अधिक https://stackoverflow.com/a/47171067/4200039 पर मेरा उत्तर को कॉपी करना:

के मुख्य लक्ष्यों में से एक:

किसी ने 2015 में डेवलपर जॉर्ज Nachman पता चलता है से प्रतिक्रिया है कि कीबाइंडिंग समर्थित नहीं हैं iTerm2 Tmux Integration Default Keybindings not working में एक समान बग रिपोर्ट tmux एकीकरण यह है कि आप iTerm2 के कीस्ट्रोक का उपयोग करते हैं, tmux के नहीं। यदि कोई विशिष्ट वर्कफ़्लो है जो आप को मूल रूप से पूरा नहीं कर सकते हैं, तो मुझे बताएं - में iTerm2 में कुंजी को रीमेप करने की क्षमता में बहुत सारी शक्ति है।

यह iTerm 2 not honoring key bindings declared in .tmux.conf का डुप्लिकेट के रूप में चिह्नित किया जाना चाहिए, लेकिन मैं झंडा नहीं कर सकते हैं यह जब तक यह एक स्वीकृत या upvoted उत्तर नहीं है।

संबंधित मुद्दे