Registers and undo branching

You might know the feeling when you delete or cut something from your text, and realize later that you needed that text elsewhere. If you have already copied / cut another piece of text, then the old text is gone because the clipboard normally has room only for one piece of text—but not in Vim.

In Vim, you have two tools that can help when you modify your text and need to keep a track of deleted / copied text or changes to the text in general:

  • Registers: Registers is sort of an advanced clipboard with multiple buffers for storing your clippings, deleted, and copied text.
  • Undo branching: Undo branching is a simple form of version control built into Vim. It gives you the possibility to roll back the changes to a file ...

Get Hacking Vim 7.2 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.