使用 Vim 返回上一行
我想知道是否有办法返回到您在 Vim 中所在的上一行。
举例来说,我正在编写 C 代码,我只想在页面顶部添加一个 #include
:我按 gg
并转到顶部,添加#include
,然后我想返回到我离开的行。
这在 Vim 中可能吗?
I was wondering if there's a way to return to the previous line you were on in Vim.
Say, for example, I'm writing C code and I just wanted to add an #include
at the top of the page: I press gg
and go to the top, add the #include
, and then I want to return to the line I left off of.
Is this possible in Vim?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的。您可以使用
``
在最后两个位置之间跳转。否则, Ctrl+O 和 Ctrl+I 可以帮助您。请参阅
:help CTRL-I
。Yes. You can use
``
in order to jump between the last two positions.Otherwise, Ctrl+O and Ctrl+I can help you. See
:help CTRL-I
.使用标记:
标记带您返回的地点(在
gg
之前)。
Use a mark:
marks the spot (before the
gg
)brings you back.