diff --git a/tmux.conf b/tmux.conf index 722b0f5..59c16ff 100644 --- a/tmux.conf +++ b/tmux.conf @@ -119,27 +119,23 @@ bind C-a send-prefix # C-a C-a = literal C-a (shell h bind-key C-o command-prompt "new-session -s %1 -c ~" bind R source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded..." -# Resizing key bindings -bind-key -r C-l resize-pane -R 5 -bind-key -r C-k resize-pane -U 5 -bind-key -r C-j resize-pane -D 5 +# Resizing key bindings (same arrow layout as the moves below, with prefix) +bind-key -r C-u resize-pane -U 5 bind-key -r C-h resize-pane -L 5 +bind-key -r C-j resize-pane -D 5 +bind-key -r C-k resize-pane -R 5 bind-key -r C-n next-window \; set status on bind-key -r C-p previous-window \; set status on -# Moving accross pane (and vim) +# Moving across panes (and vim), no prefix: ctrl + u/h/j/k laid out as arrows +# (u up, h left, j down, k right). These keys sit at the same place on AZERTY +# and QWERTY US, and need no option key. Each one still reaches vim when vim +# runs in the pane. C-l is free, so it clears the shell screen again. +# Shell cost: C-u (readline "clear the line") is taken. +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 -U" -bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" -#bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" - -# Same moves on option+arrow (iTerm2 sends them as M-arrow; "Left Option key" -# must be Esc+ or the xterm preset). C-i/C-m were ruled out: they are Tab/Enter. -bind -n M-Left if-shell "$is_vim" "send-keys M-Left" "select-pane -L" -bind -n M-Down if-shell "$is_vim" "send-keys M-Down" "select-pane -D" -bind -n M-Up if-shell "$is_vim" "send-keys M-Up" "select-pane -U" -bind -n M-Right if-shell "$is_vim" "send-keys M-Right" "select-pane -R" +bind -n C-k if-shell "$is_vim" "send-keys 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