diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index bad8329..66ad69a 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -8,13 +8,13 @@ unbind C-b # See: https://github.com/christoomey/vim-tmux-navigator is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" -bind-key -n 'C-h' if-shell "$is_vim" { send-keys C-h } { if -F '#{pane_at_left}' { } { select-pane -L } +bind-key -n 'C-h' if-shell "$is_vim" { send-keys C-h } { if -F '#{pane_at_left}' { select-pane -L } { select-pane -L } } -bind-key -n 'C-j' if-shell "$is_vim" { send-keys C-j } { if -F '#{pane_at_bottom}' { } { select-pane -D } +bind-key -n 'C-j' if-shell "$is_vim" { send-keys C-j } { if -F '#{pane_at_bottom}' { select-pane -D } { select-pane -D } } -bind-key -n 'C-k' if-shell "$is_vim" { send-keys C-k } { if -F '#{pane_at_top}' { } { select-pane -U } +bind-key -n 'C-k' if-shell "$is_vim" { send-keys C-k } { if -F '#{pane_at_top}' { select-pane -U } { select-pane -U } } -bind-key -n 'C-l' if-shell "$is_vim" { send-keys C-l } { if -F '#{pane_at_right}' { } { select-pane -R } } +bind-key -n 'C-l' if-shell "$is_vim" { send-keys C-l } { if -F '#{pane_at_right}' { select-pane -R } { select-pane -R } } tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")' if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \ "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"