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

Vim、Emacs配置和使用
回复
苍紫云龙
帖子: 117
注册时间: 2005-07-27 18:39

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

#1

帖子 苍紫云龙 » 2006-04-15 1:47

这应该是默认的功能啊,但dapper里的vim却不支持(以前的源好像也不行)

不知该如何开启?
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#2

帖子 eexpress » 2006-04-15 2:39

man 有。昨天刚看到。只是不熟悉,没记住。 :lol:
● 鸣学
头像
karron
帖子: 6226
注册时间: 2005-06-11 14:03
来自: 不明真相的群众
联系:

#3

帖子 karron » 2006-04-15 9:14

在你的.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
我的blog,关于技术,软件,linux,vim <---- 所有博客均被河蟹.
苍紫云龙
帖子: 117
注册时间: 2005-07-27 18:39

#4

帖子 苍紫云龙 » 2006-04-16 16:45

赞!谢谢~~~~
lqw0205
帖子: 118
注册时间: 2005-10-21 11:36

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

#5

帖子 lqw0205 » 2006-04-23 21:59

苍紫云龙 写了:这应该是默认的功能啊,但dapper里的vim却不支持(以前的源好像也不行)

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

代码: 全选

'0
Life would be much easier if I had the source code.
回复