vim: persistant undo
This commit is contained in:
13
vim/vimrc
13
vim/vimrc
@@ -110,10 +110,15 @@ augroup LastPosition
|
|||||||
\ endif
|
\ endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
""" Persistent undo. Requires Vim 7.3 {{{
|
" Keep undo history across sessions by storing it in a file
|
||||||
if has('persistent_undo') && exists("&undodir")
|
let vimDir = '$HOME/.vim'
|
||||||
set undodir=$HOME/.vim/undo/ " where to store undofiles
|
if has('persistent_undo')
|
||||||
set undofile " enable undofile
|
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 undolevels=500 " max undos stored
|
||||||
set undoreload=10000 " buffer stored undos
|
set undoreload=10000 " buffer stored undos
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user