, , ,

Put the following in your .vimrc file to automatically jump to the last visited line when a file is reopened using vim:

" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("’\"") > 0 && line("’\"") <= line("$")
\| exe "normal! g’\"" | endif

Alternatively, you could just reopen the file normally and then hit '0 (that is, single quote followed by the number zero) to get the same result. Source: Stack Overflow