Skip to content

Commit b68fb79

Browse files
committed
Fix freezing/hanging when navigating between vim and tmux
Fix from this comment on issue christoomey#295: christoomey#295 (comment)
1 parent d847ea9 commit b68fb79

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

plugin/tmux_navigator.vim

+18
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,21 @@ function! s:TmuxAwareNavigate(direction)
146146
let s:tmux_is_last_pane = 0
147147
endif
148148
endfunction
149+
150+
function! s:set_is_vim()
151+
call s:TmuxCommand("set-option -p @is_vim yes")
152+
endfunction
153+
154+
function! s:unset_is_vim()
155+
call s:TmuxCommand("set-option -p -u @is_vim")
156+
endfunction
157+
158+
augroup tmux_navigator_is_vim
159+
au!
160+
autocmd VimEnter * call s:set_is_vim()
161+
autocmd VimLeave * call s:unset_is_vim()
162+
if exists('##VimSuspend')
163+
autocmd VimSuspend * call s:unset_is_vim()
164+
autocmd VimResume * call s:set_is_vim()
165+
endif
166+
augroup END

0 commit comments

Comments
 (0)