使用 Vim 返回上一行 [英] Returning to previous line with Vim

查看:39
本文介绍了使用 Vim 返回上一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法返回到您在 Vim 中的上一行.

I was wondering if there's a way to return to the previous line you were on in Vim.

例如,我正在编写 C 代码,我只想在页面顶部添加一个 #include:我按 gg 并转到顶部,添加#include,然后我想返回到我离开的那一行.

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.

这在 Vim 中可行吗?

Is this possible in Vim?

推荐答案

是的.您可以使用 `` 在最后两个位置之间跳转.

Yes. You can use `` in order to jump between the last two positions.

否则,Ctrl+OCtrl+I 可以帮助您.参见 :help CTRL-I.

Otherwise, Ctrl+O and Ctrl+I can help you. See :help CTRL-I.

这篇关于使用 Vim 返回上一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆