From: "A.J.Mechelynck" <[EMAIL PROTECTED]> Subject: Re: .vim_logout ??? Date: Sat, 30 Sep 2006 11:05:28 +0200
> Meino Christian Cramer wrote: > > Hi, > > > > I am looking for a way to execute some lines of vim-script everytime > > when ich leave vim (end the programm). > > > > Are there any "hooks", which I can use for such a task ? > > > > Keep hacking! > > mcc > > > > :autocmd VimLeave * " any ex-command here > > Most (but not all) autocommands can be placed on one line, separated by | (A > few will take a following | as part of their arguments.) > > You can also use several ":autocmd" lines (the autocommands are executed in > the order defined), or, if you want a more complex script, you can e.g. do > > :autocmd VimLeave * source ~/.vim/macros/logout.vim > > see > :help :autocmd > :help VimLeave > > > Best regards > Hi, hmmmm...it still does not work, which definitely is my fault. The situation: I set if &term =~ "xterm-256color" let &t_SI = "\<Esc>]12;red\x7" let &t_EI = "\<Esc>]12;white\x7" endif which set the color of the cursor to reflect the mode (insert/normal) vim is in. The drawback of this is: When leaving vim, the color of the cursor of the terminal from which vim was started, is effected. This may result in a non visible or less then optimal readability of the cursor. So why not to reset the cursor color? I did the following: autocmd VimLeave * let &t_EI = "\<Esc>]12;green\x7" which _should_ set the cursor back to the "original" color. This does not work. Then I tried (experimental...not based on any knowledge ;O) ) autocmd VimLeave * echo "\<Esc>]12;green\x7" which also does not work. "WARNING! IDEA STACK UNDERFLOW" was the next error I got..... ;) Is there a way to reset the cursor color to "normal"...and... Is there a way to determine the original cursor color before tweaking t_SI and t_EI, to remember the color and to use it in the reset-cursor-color-code instead of hardcoding it ? Thank you very much for any help in advance ! keep hacking! mcc