分页: 1 / 1

vim如何在打开文件定位上次退出时浏览处?

发表于 : 2006-04-15 1:47
苍紫云龙
这应该是默认的功能啊,但dapper里的vim却不支持(以前的源好像也不行)

不知该如何开启?

发表于 : 2006-04-15 2:39
eexpress
man 有。昨天刚看到。只是不熟悉,没记住。 :lol:

发表于 : 2006-04-15 9:14
karron
在你的.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

发表于 : 2006-04-16 16:45
苍紫云龙
赞!谢谢~~~~

Re: vim如何在打开文件定位上次退出时浏览处?

发表于 : 2006-04-23 21:59
lqw0205
苍紫云龙 写了:这应该是默认的功能啊,但dapper里的vim却不支持(以前的源好像也不行)

不知该如何开启?
打开vim后,试试:

代码: 全选

'0