set 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. set 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.
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_...)