When dealing with source codes by using vim, I usually open and close the files repeatably. It will be good if vim can automatically jump me to the last known position when I reopen a file.
To have vim do so, you must have viminfo, which usually exist by default.
Add in the setting into your ~/.vimrc
if has("autocmd") autocmd BufReadPost * \ if line("'\"") > 1 && line("'\"") <= line("$") | \ exe "normal! g`\"" | \ endif endif
Ok, I have no idea what how it does the magic, but I know if your vim editor have autocmd capability, it will do wonders.
P.S. For gvim users, you can edit the vimrc by accessing the menu Edit > Startup Settings from the gvim.