vim记住上次编辑和浏览位置

在用户自己的目录下的.vimrc中添加,

 1 "remember last update or view postion"
 2  " Only do this part when compiled with support for autocommands 
 3  if has("autocmd")
 4  " In text files, always limit the width of text to 78 characters 
 5  autocmd BufRead *.txt set tw=78
 6  " When editing a file, always jump to the last cursor position 
 7  autocmd BufReadPost *
 8  \ if line("'\"") > 0 && line ("'\"") <= line("$") |
 9  \ exe "normal g'\"" |
10  \ endif 
11  endif

 

posted @ 2013-06-24 22:19  九月光  阅读(5053)  评论(0编辑  收藏  举报