If you, like me, are tired of vim’s pesky backup and swap files littering your project directory then you too should create a .vimtmp directory in your home folder and add this little snippet to your .vimrc

" Store vim backups and *.swp files in ~/.vimtmp with a unique name
set backupdir=~/.vimtmp//
set directory=~/.vimtmp//

Now all your backup and swap files will be stored in ~/.vimtmp/ and prefixed with a formatted file path, eg, %some%where%on%my%computer%some_file.ext.swp

Posted in Utilities at August 17th, 2009. 2 Comments
Tagged with , , . Written by: Patrik Hedman

pastbedti.me is using WP-Gravatar