Hi Toni Thank you for your answer.
You are right, the example is included as source in my _vimrc and from there comes the autocommand. I didn't realize that before. When I edit my code I usually don't close the file until I'm done with a certain part. I don't want to come back to that part again later. So now I've got it working as intended. Thanks. Reto On Mar 29, 10:39 am, Tony Mechelynck <[email protected]> wrote: > On 29/03/09 10:14, Reto wrote: > > > > > Hello everyone > > > I'm programming with VIM and I don't want the cursor position to be > > remembered. > > I've tried setting the f0 option of viminfo but that didn't work (is > > this a bug or am I missing something?). I had to disable viminfo > > completely to prevent position restore. > > > Is there a better way to disable it? > > > Thanks > > > Reto > > You probably have an autocommand similar to the following: > > " When editing a file, always jump to the last known cursor position. > " Don't do it when the position is invalid or when inside an event > handler > " (happens when dropping a file on gvim). > " Also don't do it when the mark is in the first line, that is the > default > " position when opening a file. > autocmd BufReadPost * > \ if line("'\"") > 1 && line("'\"") <= line("$") | > \ exe "normal! g`\"" | > \ endif > > The above is copied from $VIMRUNTIME/vimrc_example.vim lines 72-80. > > If you get it by invoking the vimrc_example.vim, you can remove it > afterwards by means of > > :au! vimrcEx BufReadPost > > If it is in your vimrc, you should pobably remove it manually. > > IMHO, however, that autocommand is very useful: it allows starting to > edit a file, stopping halfway, closing Vim (and perhaps the whole > machine) and restarting from where we left off. Or closing Console Vim > halfway through an edit and restarting in GUI mode (or vice-versa). And > so on. > > Best regards, > Tony. > -- > You will feel hungry again in another hour. --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
