Flaviu Simihaian's Blog - Entrepreneur and Developer

Pretty Undo Tree in Vim With Gundo

Here’s a horror story: You make a change in your editor. You undo. You make another change. Crap! You just realized you want the first change, but you can’t get it back.

Fortunately, Vim has an undo tree that keeps track of those changes. But it’s ugly. So the Gundo plugin prettifies it.

If you happen to use Janus, just add this line to your ~/.janus.rake

1
vim_plugin_task "gundo", "http://github.com/sjl/gundo.vim.git"

Then, run rake in the ~/.vim directory to install or update all your Vim plugins (including Gundo).

Don’t forget to map a key to toggle the undo tree. The author suggests F5, but since Function keys were invented by Kublai Khan, I use the more convenient Leader key + u:

1
nnoremap <Leader>u :GundoToggle<CR>

Thanks to @ciobi for showing me this awesome plugin.

Comments

Fork Flaviu on GitHub