diff --git a/vim/vimrc b/vim/vimrc index dc2272d..b861604 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -71,6 +71,17 @@ set pastetoggle= set history=100 set undolevels=150 +set undofile + +if filewritable(expand("~/.vim/tmp/undo")) == 2 + set undodir=$HOME/.vim/tmp/undo +else + if has("unix") || has("win32unix") + call system("mkdir $HOME/.vim/tmp/undo -p") + set undodir=$HOME/.vim/tmp/undo + endif +endif + set backup if filewritable(expand("~/.vim/tmp/backup")) == 2