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 Tony ! thanks a lot again for your hepl fuil reply !!! I only know "autocmd" for executing filetype related stuff - and therefore haven't even a spark of the idea to :he for that topic. The reason for asking is: I used t_SI and t_EI to switch the color of the cursor for INSERT and NORMAL mode to refect it a little nearer to the place where my looks at (the text normally and not the command line below). Sideeffect: When leaving vim, the cursor of the underlaying shell/terminal gets changed. This way I hope to revert the effect. Have a nice weekend!!! mcc