Fixes #6 by setting a window option called `vim$TMUX_PANE` during vim setup, and removing it when vim exits: ```vim if $TMUX !=# '' " Set tmux window option to detect when to change pane. let s:tmux_option = '@vim'.substitute($TMUX_PANE, '%', '\\%', 'g') call system('tmux set-window-option '.s:tmux_option.' 1') au VimLeave * call system('tmux set-window-option -u '.s:tmux_option) endif ``` Then update the `is_vim` conditional shell statement to check if this variables exists for the current pane to determine when to change tmux pane or pass through the binding to vim. ```conf in_vim='[[ "$(tmux show-window-options)" = *"@vim#{pane_id}"* ]] && \ [[ "#{pane_current_command}" != zsh ]]' ``` Additionally check if the vim task has been backgrounded by comparing the value of `#{pane_current_command}`, this is likely a bit brittle if backgrounding is used heavily but works otherwise.
Description
tmux configuration files.
Languages
Shell
100%