Step 6 of 8

14. Marks

Special marks: last change

Vim has a few special marks that are worth knowing about. You don’t have to manually set these marks — Vim does it for us — but they’re often useful targets for jumping to.

The first special mark is '., representing the last change in the current buffer. If you make any change, then move away from it, you can jump back to the place where you made the change with '..

Work through the checklist below. There’s one word too many in the editor — delete it with daw, head down to the bottom of the buffer with G, then let '. carry you straight back to the scene of the change.

Pro tip: the notion of jumping back to the last change gets a serious boost when we start looking at the changelist in the next lesson!

  1. Delete the stray word with daw The stray EXTRA is the change you'll jump back to — put your cursor anywhere on it and type daw.
  2. Jump to the bottom of the buffer Move well away from the change — press G.
  3. Jump back to your change with '. Vim remembered where the edit happened — press '..
Delete the stray word with daw The stray EXTRA is the change you'll jump back to — put your cursor anywhere on it and type daw.

Next: Jump to the bottom of the buffer

Loading editor…