diff --git a/vim/vimrc b/vim/vimrc index 457aae1..b71278f 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -110,10 +110,15 @@ augroup LastPosition \ endif augroup END -""" Persistent undo. Requires Vim 7.3 {{{ -if has('persistent_undo') && exists("&undodir") - set undodir=$HOME/.vim/undo/ " where to store undofiles - set undofile " enable undofile +" Keep undo history across sessions by storing it in a file +let vimDir = '$HOME/.vim' +if has('persistent_undo') + let myUndoDir = expand(vimDir . '/undodir') + " Create dirs + call system('mkdir ' . vimDir) + call system('mkdir ' . myUndoDir) + let &undodir = myUndoDir + set undofile set undolevels=500 " max undos stored set undoreload=10000 " buffer stored undos endif