Skip to content

Commit

Permalink
Modify grep to stop pane switch freeze
Browse files Browse the repository at this point in the history
More information can be found here: christoomey/vim-tmux-navigator#299
  • Loading branch information
Sherry Seibel committed Jan 19, 2022
1 parent 271ff23 commit bb5c785
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tmux/tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ bind -r L resize-pane -R 5

# Smart pane switching with awareness of Vim splits.
# 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)?$'"

is_vim="ps -a | grep -qE '#{s|/dev/||:pane_tty}''.*(n?)vim'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
Expand All @@ -36,7 +36,7 @@ bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' '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'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"

bind-key -T copy-mode-vi 'C-h' select-pane -L
Expand Down

0 comments on commit bb5c785

Please sign in to comment.