Visualizing the undo tree
Most modern editors support an undo stack, with undoing and replaying operations. Vim takes that one step further by introducing an undo tree. If you make a change, X, undo it, and then make a change, Y—Vim still saves the change X. Vim supports manually browsing undo tree leaves, but there’s a better way to do this.
Undotree is a plugin that visualizes the undo tree and is available from GitHub at https://github.com/mbbill/undotree.
Alternatives to Undotree
Many plugins visualize Vim’s undo tree, and Undotree is only one of them. Gundo (https://github.com/sjl/gundo.vim.git) and its more recent fork, Mundo (https://github.com/simnalamburt/vim-mundo), are other popular choices.
Quickly installing plugins
If you’re using vim-plug
to manage your plugins, add the following to your .vimrc
file: Plug 'mbbill/undotree'
. Execute :w | so $MYVIMRC | PlugInstall
and you’ll have Mundo installed and ready to go...