From dda78bb9bb994e30c321d67f2ae7facd283f0435 Mon Sep 17 00:00:00 2001 From: bchanot Date: Tue, 6 Oct 2026 16:58:19 +0200 Subject: [PATCH] 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. --- tmux.conf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tmux.conf b/tmux.conf index f229429..a3f7c84 100644 --- a/tmux.conf +++ b/tmux.conf @@ -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