tmux tabs with name of file open in vim

后端 未结 6 730
孤街浪徒
孤街浪徒 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:33

    Thanks for great input guys it saves me a lot of typing :-)

    I combined the two previous answers into one, that I like.

    autocmd BufEnter * call system("tmux rename-window " . expand("%:t"))
    autocmd VimLeave * call system("tmux rename-window bash")
    autocmd BufEnter * let &titlestring = ' ' . expand("%:t")                                                                 
    set title
    

    The first and sedond line are for tmux and the third and 4th are for normal terminal use. You don't have to restart tmux since it is vim that updates tmux explicitly.

提交回复
热议问题