navigation

This commit is contained in:
Andrei Stoica 2024-03-18 14:56:07 -04:00
parent 1cc9378eca
commit 801d97d217
1 changed files with 4 additions and 4 deletions

View File

@ -47,10 +47,10 @@ set-option -g renumber-windows on
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'"
bind-key -n -r 'C-h' if-shell "${is_vim}" 'send-keys C-h' 'select-pane -L'
bind-key -n -r 'C-j' if-shell "${is_vim}" 'send-keys C-j' 'select-pane -D'
bind-key -n -r 'C-k' if-shell "${is_vim}" 'send-keys C-k' 'select-pane -U'
bind-key -n -r 'C-l' if-shell "${is_vim}" 'send-keys C-l' 'select-pane -R'
bind-key -n -T prefix k if-shell "${is_vim}" 'send-keys C-h' 'select-pane -L'
bind-key -n -T prefix j if-shell "${is_vim}" 'send-keys C-j' 'select-pane -D'
bind-key -n -T prefix h if-shell "${is_vim}" 'send-keys C-k' 'select-pane -U'
bind-key -n -T prefix l if-shell "${is_vim}" 'send-keys C-l' 'select-pane -R'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \