vim: persistant undo

This commit is contained in:
2015-12-04 10:41:11 +01:00
parent fa4b6f0870
commit 0d4285314c

View File

@@ -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