Marks and the Jumplist

Marks

ma          " set mark a here
`a          " jump back to exactly that spot
'a          " jump to the start of that line

Lowercase marks are per-file; uppercase (mA) are global and jump between files.

Useful built-ins:

MarkMeans
``where you were before the last jump
`.where you last made a change
`^where you last left insert mode

The jumplist

Vim records every “big” move — searches, G, gg, mark jumps, %.

  • Ctrl-o — back to the previous position
  • Ctrl-i — forward again

Think of it as browser back/forward for your cursor. :jumps lists the history.

This is the same mechanism Ctrl-] uses when following a help link.