From 88715534e9a1aed049b0ed98b86238aa2fb8c92d Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 9 Mar 2013 14:49:34 -0300 Subject: Fix terminal title after leaving vim when running forked --- modules/vim/vimrc.dot.link | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'modules/vim') diff --git a/modules/vim/vimrc.dot.link b/modules/vim/vimrc.dot.link index 3490924..99b99db 100644 --- a/modules/vim/vimrc.dot.link +++ b/modules/vim/vimrc.dot.link @@ -18,6 +18,27 @@ set title set titleold="terminal" set titlestring=vim:\ %F +" See http://vim.wikia.com/wiki/Automatically_set_screen_title +"autocmd BufLeave * !xtitle mutt +"autocmd VimLeavePre * let &titlestring="mutt" +"autocmd VimLeavePre * !xtitle mutt +"autocmd VimLeavePre * !xtitle mutt +"autocmd VimLeavePre *mutt* let &titlestring="mutt" +"autocmd VimLeavePre *remind* let &titlestring="wyrd" + +" 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 " a:title +endfunction + +au VimLeave *mutt/* silent call ResetTitle("mutt") +au VimLeave *remind/* silent call ResetTitle("wyrd") + " Folding set foldmethod=syntax let php_folding = 1 @@ -31,7 +52,7 @@ au BufNewFile,BufRead *.mdwn set ft=ikiwiki au BufNewFile,BufRead *.rem set ft=remind augroup mkd - autocmd BufRead *.mkd set ai formatoptions=tcroqn2 comments=n:> + autocmd BufRead *.mkd set ai formatoptions=tcroqn2 comments=n:> augroup END if has("autocmd") -- cgit v1.2.3