diff options
| author | srdusr <trevorgray@srdusr.com> | 2024-03-25 06:02:51 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2024-03-25 06:02:51 +0200 |
| commit | e091cb0eaed708b831fb001968db9bb2ba51015d (patch) | |
| tree | dddcc9fd371a70dbd0a27d908b4edc1d60adb551 /.vim | |
| parent | ce909c8f1c4bc322f9c59b3b5ace437be3e94ebe (diff) | |
| download | dotfiles-e091cb0eaed708b831fb001968db9bb2ba51015d.tar.gz dotfiles-e091cb0eaed708b831fb001968db9bb2ba51015d.zip | |
Fixed tmux vi-mode
Diffstat (limited to '.vim')
| -rw-r--r-- | .vim/vimrc | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -468,7 +468,8 @@ map <leader>r :call RenameFile()<cr> augroup END "------------------------------------------------------------------------------- - +" +" Function to update tmux status function! UpdateTmuxStatus() if &filetype == "man" return @@ -491,20 +492,16 @@ function! UpdateTmuxStatus() let VI_MODE = "" " Clear VI_MODE to show vim mode silent execute "!tmux refresh-client -S" endif - - " Force tmux to update the status - silent execute "!tmux refresh-client -S" + silent execute "!tmux refresh-client -S" endfunction -augroup TmuxStatus - autocmd! - autocmd InsertLeave,InsertEnter * call UpdateTmuxStatus() - autocmd VimEnter * call UpdateTmuxStatus() - autocmd BufEnter * call UpdateTmuxStatus() - autocmd ModeChanged * call UpdateTmuxStatus() - autocmd WinEnter,WinLeave * call UpdateTmuxStatus() -augroup END - +" Set up autocommands for tmux status update +if !empty($TMUX) && system('command -v tmux >/dev/null 2>&1') == 0 + augroup TmuxStatus + autocmd! + autocmd InsertLeave,InsertEnter,VimEnter,BufEnter,ModeChanged,WinEnter,WinLeave * call UpdateTmuxStatus() + augroup END +endif "------------------------------------------------------------------------------- |
