aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim')
-rw-r--r--vim/vimrc13
1 files changed, 9 insertions, 4 deletions
diff --git a/vim/vimrc b/vim/vimrc
index a43c63e0..5cc14f01 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -96,11 +96,16 @@ set backup
" people assumed it would work the same way, when in fact Vim simply ignored
" it until v8.1.251.
"
-" I think options named something like 'backuppath', 'swapfilepath', and
-" 'undopath' would be much clearer.
+" I don't want to add the slashes to the option value in older versions of Vim
+" where they don't do anything, so I check the version before I add them.
"
-let s:backup_full_path = vimrc#Version('8.1.251')
-let s:backupdir = $MYVIM.'/cache/backup'.(s:backup_full_path ? '//' : '')
+" It's all so awkward. Surely options named something like 'backupfullpath',
+" 'swapfilefullpath', and 'undofullpath' would have been clearer.
+"
+let s:backupdir = $MYVIM.'/cache/backup'
+if vimrc#Version('8.1.251')
+ let s:backupdir .= '//'
+endif
execute 'set backupdir^='.vimrc#EscapeSetPart(s:backupdir)
" Create the first path in the 'backupdir' list, the one we just added, if it