vim: persistant undo
This commit is contained in:
13
vim/vimrc
13
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
|
||||
|
||||
Reference in New Issue
Block a user