diff --git a/tmux.conf b/tmux.conf index 69c0175..29c3a34 100644 --- a/tmux.conf +++ b/tmux.conf @@ -62,14 +62,13 @@ bind '"' split-window -c '#{pane_current_path}' bind '%' split-window -h -c '#{pane_current_path}' # Integrate pane selection with vim -is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"' -unbind -T copy-mode-vi C-h -unbind -T copy-mode-vi C-j -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" +in_vim='[[ "$(tmux show-window-options)" = *"@vim#{pane_id}"* ]] && \ + [[ "#{pane_current_command}" != zsh ]]' +bind -n C-h if $in_vim 'send-keys C-h' 'select-pane -L' +bind -n C-j if $in_vim 'send-keys C-j' 'select-pane -D' +bind -n C-k if $in_vim 'send-keys C-k' 'select-pane -U' +bind -n C-l if $in_vim 'send-keys C-l' 'select-pane -R' +bind -n C-\ if $in_vim 'send-keys C-\\' 'select-pane -l' # Integrate urlview bind u capture-pane \; split-window 'tmux show-buffer | urlview -'