fix(tmux): ctrl+u/h/j/k switch panes in copy-mode too
Stock copy-mode-vi table binds C-h cursor-left, C-u halfpage-up and C-j copy, so the pane moves turned into text navigation once scrolled. Arrows keep that job; the four keys now select-pane in copy-mode like at root.
This commit is contained in:
@@ -138,6 +138,13 @@ bind -n C-u if-shell "$is_vim" "send-keys C-u" "select-pane -U"
|
||||
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
|
||||
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
|
||||
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -R"
|
||||
# Copy-mode has its own key table, where stock tmux turns these keys into text
|
||||
# navigation (C-h cursor-left, C-u halfpage-up, C-j copy). Arrows do that job;
|
||||
# the four keys keep switching panes there too.
|
||||
bind -T copy-mode-vi C-u select-pane -U
|
||||
bind -T copy-mode-vi C-h select-pane -L
|
||||
bind -T copy-mode-vi C-j select-pane -D
|
||||
bind -T copy-mode-vi C-k select-pane -R
|
||||
|
||||
bind Escape copy-mode # bind vi-like 'normal' mode
|
||||
bind -Tcopy-mode-vi 'v' send -X begin-selection # bind vi-like visual mode
|
||||
|
||||
Reference in New Issue
Block a user