>>  nmap \s <Esc>:let cp=getpos(".")<C-CR>:echo cp<C-CR><Esc> "Saves the
>> cursor's position
>>  nmap \g <Esc>:call setpos('.',cp)<C-CR><Esc> "Set's the cursor back
>> to the saved location
>>
>> You must save the position before scrolling. I hope that his will do
>> the trick for you.
> 
> Just out of interest, how is this different to using marks?

The only benefit(s) I see involve not using/overwriting named 
marks.  So you can have an arbitrary number of them (with a 
little extension) stored in a List; or if you need to refrain 
from overwriting the existing marks, this is a decent way to do it.

However, in every other case, I'd say using marks wins -- it's 
portable to vi/nvi/etc as well as minimal builds of vim where 
+eval wasn't included.

-tim




--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to