Vim 中的光标移动历史

Vi.*_*Vi. 12 vim history undo cursor

如何在 Vim 中恢复光标在滚动、选择或 PgUp/PgDn 之前的位置?

在我向上滚动查看顶部的内容之前,我已经厌倦了搜索我所在的位置。

是否有类似“上一个光标位置”和“下一个光标位置”命令(例如用于常规撤消/重做的“u”和“R”)?

示例:查看源文件中间的某处(未编辑),然后跳到顶部 ( 1G),然后找不到您之前所在的位置。当然,没有设置标记。(我知道我可以使用 ":sp" 同时查看多个位置)。

更新。问题仍然悬而未决,我收到了后续:

The answerers didn't understand your question and the answers were too weak of a solution. c-o & c-i don't work for movements.
If I understood correctly, I find that your question was un-answered and that you were looking for a solution for a scenario like this:
As I am vim beginner I frequently do incorrect movements and actions and would like to undo them as though I had never pressed anything, returning to my previous editing location before I started messing up.
Run Code Online (Sandbox Code Playgroud)

那么,是否有任何标准或非标准(涉及 Vim 或 Vim 扩展的补丁)方法可以让它记住光标移动历史?

aki*_*ira 10

  • Ctrlo 返回跳转列表
  • Ctrli 在跳转列表中前进

另外,我会考虑通过m'滚动按下来设置标记''