Re: .vim_logout ???

2006-10-01 Thread Yakov Lerner

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,

 h...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


Re: .vim_logout ???

2006-10-01 Thread Meino Christian Cramer
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,
 
   h...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


Re: .vim_logout ???

2006-09-30 Thread A.J.Mechelynck

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


Re: .vim_logout ???

2006-09-30 Thread Meino Christian Cramer
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


Re: .vim_logout ???

2006-09-30 Thread Meino Christian Cramer
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,

 h...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