" window_title.vim - Window title handling " " Author: Silvio Rhatto " Basic settings set title set titleold="terminal" set titlestring=vim:\ %F " Handling titles when vim is embedded in specific programs augroup vimleave autocmd! au VimLeave *mutt/* silent call ResetTitle("mutt") au VimLeave *remind/* silent call ResetTitle("calendar") augroup END " Reset window titles " " Thanks to http://stackoverflow.com/questions/1673649/vimrc-action-onclose function! ResetTitle(title) " disable vim's ability to set the title exec "set title t_ts='' t_fs=''" " and restore it "exec ":!echo -e '\033kbash\033\\'\" exec ":!xtitle -q " a:title endfunction