diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-08 20:35:59 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-08 20:35:59 +1200 |
commit | c294bc81d656c43d00e3d4a7d8dd9f6300b866cc (patch) | |
tree | 27d86bb8db9f223cf3c0ee26b72543ab4a483f51 /vim/vimrc | |
parent | Reverse overzealous factoring out of variable (diff) | |
download | dotfiles-c294bc81d656c43d00e3d4a7d8dd9f6300b866cc.tar.gz dotfiles-c294bc81d656c43d00e3d4a7d8dd9f6300b866cc.zip |
Adjust 'backupdir' path specification for clarity
Diffstat (limited to 'vim/vimrc')
-rw-r--r-- | vim/vimrc | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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 |