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.
This commit is contained in:
2026-02-04 02:39:27 +02:00
parent 6b11727540
commit bafb8fc2f6

View File

@@ -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 <prefix> + 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"