From bafb8fc2f6b6d8b6d9958a9b8faca0bced9c93e7 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Wed, 4 Feb 2026 02:39:27 +0200 Subject: [PATCH] refactor(tmux): update keybindings for pane nav and copy mode Switch pane navigation from Alt-arrow to Ctrl-arrow (Alt doesn't work reliably on Linux). Add copy-mode-vi clipboard bindings and C-p/C-n for window switching. --- config/tmux/tmux.conf | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf index d21928b..d26c42c 100644 --- a/config/tmux/tmux.conf +++ b/config/tmux/tmux.conf @@ -62,11 +62,11 @@ set -g @catppuccin_window_middle_separator " " set -g prefix C-Space bind C-Space send-prefix -# Use Alt-arrow keys without prefix key to switch panes -bind -n M-Left select-pane -L -bind -n M-Right select-pane -R -bind -n M-Up select-pane -U -bind -n M-Down select-pane -D +# Use Ctrl-arrow keys without prefix key to switch panes +bind -n C-Left select-pane -L +bind -n C-Right select-pane -R +bind -n C-Up select-pane -U +bind -n C-Down select-pane -D # Reload tmux config with + r unbind r @@ -80,6 +80,14 @@ bind Escape copy-mode unbind p bind p paste-buffer +# copy-mode-vi: y copies to system clipboard, Y copies and pastes +bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel +bind -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel "tmux paste-buffer" + +# easier switching between next/prev window +bind C-p previous-window +bind C-n next-window + # global sessions bind -N "sesh selection" t display-popup -E "$HOME/.dotfiles/config/tmux/sesh-gum.sh" bind -N "last-session (via sesh) " L run-shell "sesh last"