From 46454f2d385f4083f305c456a173866d0f557edf Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 10 Nov 2016 22:58:53 +0300 Subject: [PATCH] .vimrc: keep undo history across sessions by storing it in a file --- .vimrc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 852d3cb..745587a 100644 --- a/.vimrc +++ b/.vimrc @@ -129,7 +129,7 @@ endif if has("win32") set directory=$TEMP//,c:/tmp//,c:/temp// else - set directory=~/tmp//,/var/tmp//,/tmp// + set directory=~/tmp/vim//,~/tmp//,/var/tmp//,/tmp// endif " if a directory ends in two path separators "//" " or "\\", the swap file name will be built from the complete path to @@ -144,6 +144,15 @@ set wildignore+=*.py[co] " Ignore these patterns when completing file names set wildmenu " command-line completion shows a list of matches set wildmode=longest,list:longest,full " Bash-vim completion behavior +" Keep undo history across sessions by storing it in a file +if has('persistent_undo') + let myUndoDir = expand('$HOME/tmp/vim/undo') + " Create dirs + call system('mkdir -p ' . myUndoDir) + let &undodir = myUndoDir + set undofile +endif + " 22 executing external commands if has("filterpipe") -- 2.39.5