Yakov Lerner wrote:
Forwarding to the ist
---------- Forwarded message ----------
From: Fletcher Mattox <[EMAIL PROTECTED]>
Date: Oct 7, 2006 3:21 PM
Subject: Re: how to remember file offsets?
To: Yakov Lerner <[EMAIL PROTECTED]>
On 10/6/06, Fletcher Mattox <[EMAIL PROTECTED]> wrote:
> Hi,
>
> When I edit two files by typing ":e foo" and ":e #", vim remembers
> my current location in each and kindly positions me there when
> I revisit them. However, when I edit three or more files, vim forgets
> where I was and always positions the cursor at the top of the file.
> How do I get vim to remember where I was in an arbitrary number
> of files?
Check that you have option 'viminfo properly set
(:help 'vimnifo') in your vimrc; and check that you have
following in your vimrc:
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
Yakov
Yakov,
Perfect! Thank you so much for spelling this out. One of the other
list members
alluded to this solution, but I couldn't quite put it all together (I am
a new
vim user) until your email arrived.
Thanks again,
Fletcher
Well, the solution to which I alluded includes this implicitly by having the
line
source $VIMRUNTIME/vimrc_example.vim
near the top of your vimrc.
Best regards,
Tony.