vim-tmux-navigator
vim-tmux-navigator copied to clipboard
Cannot switch panes from plugin script running inside vim
When I execute a vim plugin that requires running a shell command, the tmux-navigator key bindings become unresponsive until the script finishes running and control is returned to vim. However, a
My temporary workaround is to check that no other processes are running besides bash and vim:
is_vim="[[ -n ps -o state= -o comm= -t '#{pane_tty}' \ | grep -iE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'
&& -z ps -o comm= -t '#{pane_tty}' \ | grep -iEv '^(bash|n?vim?x?)$'
]]"
I'm sure this would fail on some corner cases, but works for my purposes, both local and ssh. (I had to remove the grep -q flag for the statement to work inside the test block.)