这应该是默认的功能啊,但dapper里的vim却不支持(以前的源好像也不行)
不知该如何开启?
vim如何在打开文件定位上次退出时浏览处?
-
- 帖子: 117
- 注册时间: 2005-07-27 18:39
- karron
- 帖子: 6226
- 注册时间: 2005-06-11 14:03
- 来自: 不明真相的群众
- 联系:
在你的.vimrc中添加
" Only do this part when compiled with support for autocommands
if has("autocmd")
" In text files, always limit the width of text to 78 characters
autocmd BufRead *.txt set tw=78
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif
endif
" Only do this part when compiled with support for autocommands
if has("autocmd")
" In text files, always limit the width of text to 78 characters
autocmd BufRead *.txt set tw=78
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif
endif
我的blog,关于技术,软件,linux,vim <---- 所有博客均被河蟹.
-
- 帖子: 118
- 注册时间: 2005-10-21 11:36
Re: vim如何在打开文件定位上次退出时浏览处?
打开vim后,试试:苍紫云龙 写了:这应该是默认的功能啊,但dapper里的vim却不支持(以前的源好像也不行)
不知该如何开启?
代码: 全选
'0
Life would be much easier if I had the source code.