When a text file is reopened with vim, the cursor appears where it was
left last time. But this is not robust, at least to my experience (at
least when vim is updated, I've lost information about the position of
the cursor).
So, unless there is a way to really keep the information, I would like
to make a script (in Perl, probably) that would work like this:
        readwithvim mytextfile
The script readwithvim would read a text file containing the last line
number (saved last time the script was used) and would call vim to open
the text file mytextfile in that line number (this part is easy).
On quitting vim, the current line number should be written to a text
file. This is the part I don't know how to implement. It had to execute
a script on exit, and it had to pass the line number to the script...
On the other hand, if vim could write the line number to STDOUT on exit,
the value could be catched by the parent script "readwithvim".
Any idea?

-- 
Jorge Almeida

Reply via email to