aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-03-09 14:49:34 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-03-09 14:49:34 -0300
commit88715534e9a1aed049b0ed98b86238aa2fb8c92d (patch)
tree663a62339d2fe47539f5d915363fb3b1047b0fb1
parent9c15ac6b3af271ad52a95af474abff893b55e3f9 (diff)
downloaddotfiles-88715534e9a1aed049b0ed98b86238aa2fb8c92d.tar.gz
dotfiles-88715534e9a1aed049b0ed98b86238aa2fb8c92d.tar.bz2
Fix terminal title after leaving vim when running forked
-rw-r--r--modules/vim/vimrc.dot.link23
1 files changed, 22 insertions, 1 deletions
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\\'\<CR>"
+ 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")