From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.2-2smp i686; en-US; rv:0.9+) Gecko/20010507 Description of problem: Vim is not saving/restoring the cursor position from ~/.viminfo data. It always goes to the top of the file. I don't think it is being read. I've tried on two machines, one stock, one slightly modified built from src.rpm (7.1 src.rpm). Same results on both, and same results with vim-X11 and enhanced-vim. Looking at .viminfo, it is indeed being updated, just apparently not read when vim opens a file. [hal@feenix hal]$ vim +version +q! |grep viminfo +vertsplit +virtualedit +visual +visualextra +viminfo +wildignore +wildmenu +windows [hal@feenix hal]$ grep viminfo .vimrc set viminfo='25,h [hal@feenix hal]$ strace -o /tmp/trace vim -g ~/.vimrc [hal@feenix hal]$ grep viminfo /tmp/trace <nada> Sanity check: [hal@feenix hal]$ grep \.vimrc /tmp/trace |wc -l 15 How reproducible: Always Steps to Reproduce: 1.open file, move cursor down 2.close file 3.re-open file, and find cursor at top. Actual Results: As expected. Expected Results: Cursor should move to previous mark in file at the time it was closed. At least, this is how it worked on previous versions (vim 5.7). Additional info:
Works here... Make sure you aren't turning the feature off in your ~/.vimrc. Also, vim-minimal doesn't have this feature.
Well, this clearly is not vim minimal. Anyway, through process of elimination I found that this was caused by 'autocmd!' in .vimrc. Commenting this out, solves problem. This line has been there through many versions of vim, so not sure what the deal is with 6.0.