X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.vimrc;h=e0b32985a97dc55725f81739576987702b045bec;hb=7ae608fc1103371b8fa72fb027fb8206c25e9a15;hp=852d3cb21fb0abe5c8ae7a1a37c151f762295f09;hpb=2c8a3af9a83c63d371a5ba6463230e5e02b8e875;p=dotfiles.git diff --git a/.vimrc b/.vimrc index 852d3cb..e0b3298 100644 --- a/.vimrc +++ b/.vimrc @@ -125,11 +125,17 @@ endif " 20 the swap file +let myUndoDir = expand('~/tmp/vim/undo') +if !isdirectory(myUndoDir) + " Create dirs + call mkdir(myUndoDir, 'p') +endif + " list of directories for the swap file; remove . (the current directory) if has("win32") - set directory=$TEMP//,c:/tmp//,c:/temp// + set directory=~/tmp/vim//,$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 +150,12 @@ 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 &undodir = myUndoDir + set undofile +endif + " 22 executing external commands if has("filterpipe")