恢复文件关闭之前光标的位置

刚才翻看了Vim的全局配置/etc/vim/vimrc,里面有被注释的这么几行:

1
2
3
4
5
" 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("$") | exe "normal! g'\"" | endif
"endif

你可能感兴趣的:(文件)