summaryrefslogtreecommitdiffstats
path: root/content/posts/a-usable-vim-undo-tree.rst
diff options
context:
space:
mode:
Diffstat (limited to 'content/posts/a-usable-vim-undo-tree.rst')
-rw-r--r--content/posts/a-usable-vim-undo-tree.rst35
1 files changed, 35 insertions, 0 deletions
diff --git a/content/posts/a-usable-vim-undo-tree.rst b/content/posts/a-usable-vim-undo-tree.rst
new file mode 100644
index 0000000..931f30d
--- /dev/null
+++ b/content/posts/a-usable-vim-undo-tree.rst
@@ -0,0 +1,35 @@
+A usable VIM Undo tree
+##################################
+:date: 2014-04-15 14:20
+:tags: vim, undo
+
+
+As some may have heard, vim stores your actions (and undos) as a tree, which is
+great. With vim 7.3 there is even a option to persist these changes between
+session. But with vanilla vim this tree is pretty much unusable.
+
+A friend showed me a great plugin which gives vim git-like super powers by
+showing undos in a tree, together with a patch view with the `gundo plugin <https://github.com/sjl/gundo.vim>`_.
+
+This plugin, together with persistent undo files feels almost like when i have used ctrl-r for the shell the first time!
+
+Configuration
+-------------
+
+Grab vundle for VIM, `install it
+<https://github.com/gmarik/Vundle.vim>`_.
+
+Add these lines to your vimrc:
+
+.. code-block:: vim
+
+ Bundle 'sjl/gundo.vim'
+ nnoremap <F5> :GundoToggle<CR>
+ set undodir=~/.vim/undo
+ set undofile
+ "maximum number of changes that can be undone
+ set undolevels=1000000
+ "maximum number lines to save for undo on a buffer reload
+ set undoreload=10000000
+
+In vim run **:BundleInstall** , you can now toggle the undo bar with **<F5>**.