Vim能回到刚才的光标位置吗?

941 views
Skip to first unread message

pim

unread,
Aug 29, 2010, 11:59:13 AM8/29/10
to Vim.cn
注意不是回到文件上次关闭前的光标位置。

举个例子吧,打开一个文件,光标最先在第10行,我做了一些编辑,然后用20G跳到第20行,又作了一些编辑工作,然后我又想跳回第十行,有相关的快捷
键吗

Jason Jia

unread,
Aug 29, 2010, 8:25:57 PM8/29/10
to vim...@googlegroups.com
ctrl + o

2010/8/29 pim <gaici...@gmail.com>
注意不是回到文件上次关闭前的光标位置。

举个例子吧,打开一个文件,光标最先在第10行,我做了一些编辑,然后用20G跳到第20行,又作了一些编辑工作,然后我又想跳回第十行,有相关的快捷
键吗

--
要退订此论坛,请发邮件至 Vim-cn-un...@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/Vim-cn 访问该论坛

Bill Liao

unread,
Aug 29, 2010, 8:27:44 PM8/29/10
to vim...@googlegroups.com
C+O C+I
太常用了吧..
看来你没看tutor啊..

2010/8/30 Jason Jia <jsf...@gmail.com>:

--
If the dream is BIG enough,the facts don't count!

祁伟

unread,
Aug 29, 2010, 9:41:53 PM8/29/10
to vim...@googlegroups.com
m a(a-z)
'a (a-z)

mybeky

unread,
Aug 29, 2010, 9:57:11 PM8/29/10
to vim...@googlegroups.com
g;

2010/8/30 祁伟 <qiwe...@gmail.com>



--
Absence to love is what wind is to fire. It extinguishes the small,but inflames the great.

pim

unread,
Aug 29, 2010, 11:55:35 PM8/29/10
to vim...@googlegroups.com
谢谢诸位高手,在下刚用vim不久,受益匪浅

Jarod

unread,
Aug 30, 2010, 2:28:16 AM8/30/10
to Vim.cn
``

当然你可以用marks 标记

pim

unread,
Aug 30, 2010, 2:41:36 AM8/30/10
to Vim.cn
··也挺方便,好像只能在最近两个焦点来回切换,不过我一般需要切换的情况不会返回超过2个焦点

另外C+O C+I和g;有什么区别啊,好像g;一直在本文件里面回溯,C+O C+I跨文件记录的,g;有相关的反操作没有啊

> > 键吗- 隐藏被引用文字 -
>
> - 显示引用的文字 -

Jason Jia

unread,
Sep 7, 2010, 9:50:35 PM9/7/10
to vim...@googlegroups.com
与g;相对的是g,
这个和可以在 :help g; 中看到

2010/8/30 pim <gaici...@gmail.com>
Reply all
Reply to author
Forward
0 new messages