2 ms·
or just do: set backupdir=./.backup,.,/tmp set directory=.,./.backup,/tmp This way, if you want your backups to be neatly grouped, just create a directory ca
by jessor 16y ago
or just do:
set backupdir=./.backup,.,/tmp
set directory=.,./.backup,/tmp
This way, if you want your backups to be neatly grouped, just create a directory called '.backup' in your working directory. Vim will stash backups there. The 'directory' option controls where swap files go. If your working directory is not writable, Vim will put the swap file in one of the specified places.
(http://vim.wikia.com/wiki/Remove_swap_and_backup_files_from_your_working_directory http://vim.wikia.com/wiki/Remove_swap_and_backup_files_from_...)
- parfe 16y agoset backupdir=~/.vim/backup// set directory=~/.vim/swp// The double tailing slash will store files using full paths so if you edit two different models.py files you won't clobber your swap or backups.
- davidu 16y agoOh man, this is awesome. Too bad it's vim-specific and not a shell built-in, which would be handy.