From: "Yakov Lerner" <[EMAIL PROTECTED]>
Subject: Re: .vim_logout ???
Date: Sun, 1 Oct 2006 16:31:44 +0300

> On 10/1/06, Meino Christian Cramer <[EMAIL PROTECTED]> wrote:
> > 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"
> 
> No, this will not work (vim's builtin echo translates Esc to ^[).
> Try something like:
>      autocmd VimLeave * silent !echo -e '\e]12;green\007'
> (untested)
> 
> Yakov
> 

Hi Yakov !

 Thanks a lot for the reply and your helping hands!
 I will see, how grenn I can get the cursor with it ! :)))))))

 keep hacking!
 mcc

Reply via email to