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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM