让VIM打开文件时回到上次的光标位置:
编辑/etc/vim/vimrc,启动这段:
" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("{1}quot;) | exe "normal! g'\"" | endif
endif