Navigate Between Files with Jumps

This post extracts some knowledge from Practical Vim Chapter 9 -- Navigate Between Files with Jumps.

[!TIP] Traverse the Jump List

Each separate window has its own jump list.

C-o and u

[!TIP] Traverse the Change List

we press g;, that places the cursor back on the line and column where it ended up after the previous edit. The result is the same as if we had pressed u, except that we don’t make any transitory changes to the document. g, is the reverse direction.

The `. mark always references the position of the last change, while the `^ mark tracks the position of the cursor the last time that Insert mode was stopped.

[!TIP] Jump to the Filename Under the Cursor

Use gf to go to the filename under the cursor.

:set path?
:set suffixesadd?

[!TIP] Snap Between Files Using Global Marks

The m{letter} command allows us to create a mark at the current cursor position. Lowercase letters create marks that are local to a buffer, whereas uppercase letters create global marks. Having set a mark, we can snap our cursor back to it with the `{letter} command.


原文链接:https://zhuang.dev/reading/practical-vim/09-navigate-bwtween-files-with-jumps/

posted @ 2026-07-12 22:50  neozhuang  阅读(5)  评论(0)    收藏  举报