aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-10 11:31:41 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-10 11:31:41 +1200
commit38199a0cbc7967aa398097b803fe713350ef5038 (patch)
treeb1a9c19cf749be7586ee10834c53690685130a6a
parent61a6202619a3e8293d57b7071f40b5ab266f955c (diff)
downloaddotfiles-38199a0cbc7967aa398097b803fe713350ef5038.tar.gz
Handle encoded path in Vim metadata correctly
-rw-r--r--vim/vimrc16
1 files changed, 12 insertions, 4 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 67100d0b..3a51a829 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -56,9 +56,15 @@ set backspace+=eol " Line breaks
set backspace+=indent " Spaces from 'autoindent'
set backspace+=start " The start of current insertion
-" Try to keep backups in one system-appropriate dir
+" Try to keep backups in one system-appropriate dir, including full encoded
+" path in filename (trailing double slash) if supported (8.1.0251)
set backup
-set backupdir^=$MYVIMRUNTIME/cache/backup
+if v:version > 801
+ \ || v:version == 801 && has('patch251')
+ set backupdir^=$MYVIMRUNTIME/cache/backup//
+else
+ set backupdir^=$MYVIMRUNTIME/cache/backup
+endif
" Add some paths not to back up
if has('unix')
@@ -88,7 +94,8 @@ set confirm
" Yes, I have become a filthy two-spacer
set cpoptions+=J
-" Try to keep swapfiles in one system-appropriate dir
+" Try to keep swapfiles in one system-appropriate dir, including full encoded
+" path in filename (trailing double slash)
set directory^=$MYVIMRUNTIME/cache/swap//
" Use UTF-8 if we can and env LANG didn't tell us not to
@@ -203,7 +210,8 @@ if exists('+ttymouse') && &ttymouse !=# ''
set ttymouse=
endif
-" Keep undo files, hopefully in a dedicated directory
+" Try to keep persistent undo files in one system-appropriate dir, including
+" full encoded path in filename (trailing double slash)
if has('persistent_undo')
set undofile
set undodir^=$MYVIMRUNTIME/cache/undo//