diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-11 10:29:53 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-11 10:29:53 +1200 |
commit | 3392ff345e730c40a2575694242451b5e470ea51 (patch) | |
tree | 62d2449c93129bbc20ab2deeed2e96f473141f8d | |
parent | Rearrange vimrc autocmds (diff) | |
download | dotfiles-3392ff345e730c40a2575694242451b5e470ea51.tar.gz dotfiles-3392ff345e730c40a2575694242451b5e470ea51.zip |
Rearrange 'backupskip' changes logic
-rw-r--r-- | vim/vimrc | 26 |
1 files changed, 12 insertions, 14 deletions
@@ -349,6 +349,14 @@ else set backupdir^=$MYVIM/cache/backup endif +" Vim doesn't seem to check patterns added to 'backupskip' for uniqueness, +" so adding them repeatedly if this file is reloaded results in duplicates, +" due to the absence of the P_NODUP flag for its definition in src/option.c. +" This is likely a bug in Vim. For the moment, to work around the problem, +" we reset the path back to its default first. +" +set backupskip& + " Files in certain directories on Unix-compatible filesystems should not be " backed up for reasons of privacy, or an intentional ephemerality, or both. " This is particularly important if editing temporary files created by @@ -356,22 +364,12 @@ endif " value of 'backupskip' in order to prevent the creation of such undesired " backup files. " +" * /dev/shm: RAM disk, default path for password-store's temporary files +" * /usr/tmp: Hard-coded path for sudoedit(8) [1/2] +" * /var/tmp: Hard-coded path for sudoedit(8) [2/2] +" if has('unix') - - " Vim doesn't seem to check patterns added to 'backupskip' for uniqueness, - " so adding them repeatedly if this file is reloaded results in duplicates, - " due to the absence of the P_NODUP flag for its definition in src/option.c. - " This is likely a bug in Vim. For the moment, to work around the problem, - " we reset the path back to its default first. - " - set backupskip& - - " * /dev/shm: RAM disk, default path for password-store's temporary files - " * /usr/tmp: Hard-coded path for sudoedit(8) [1/2] - " * /var/tmp: Hard-coded path for sudoedit(8) [2/2] - " set backupskip^=/dev/shm/*,/usr/tmp/*,/var/tmp/* - endif " Relax traditional vi's harsh standards over what regions of the buffer can |