tmux tabs with name of file open in vim

后端 未结 6 729
孤街浪徒
孤街浪徒 2020-12-04 15:42

I\'m new to tmux and am trying to figure out how to edit the configuration so that windows with vim open show up in the taskbar not as #:vim but as whatever the

6条回答
  •  时光取名叫无心
    2020-12-04 16:19

    And to restore automatic window title on Vim exit:

    autocmd VimLeave * call system("tmux setw automatic-rename")
    

    I would also suggest to check if we are running under tmux:

    if exists('$TMUX')
        autocmd BufEnter * call system("tmux rename-window '" . expand("%:t") . "'")
        autocmd VimLeave * call system("tmux setw automatic-rename")
    endif
    

提交回复
热议问题