-
-
Save yujinyuz/827ab1977fc81173569558c81a5eaa03 to your computer and use it in GitHub Desktop.
better vim backup strategy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# clean up any backups not used in the past 7 days out of the ~/.backup directory | |
@daily find ~/.backup -type f -name '*;*' -not \( -atime 0 -or -atime 1 -or -atime 2 -or -atime 3 -or -atime 4 -or -atime 5 -or -atime 6 \) -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" set where to write backups to | |
set backupdir=~/.backup | |
" and the backup extension | |
au BufWritePre * let &bex = substitute(expand('%:p:h'), '/', ':', 'g') . strftime(';%FT%T') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment