Last Updated: February 25, 2016
· tanjapislar

Beginner's Vim: Control your swap files

Does it annoy you to have those .swp files all over the place?

Did you know that you can keep them all in one place, let's say, under ~/.vim/tmp ?

Easy - insert this line in your vimrc:

set directory=$HOME/.vim/tmp/ 

3 Responses
Add your response

vim is miraculous, more tips&tricks:

over 1 year ago ·

You can also have vim not save swap altogether:

:set noswapfile
over 1 year ago ·

You can also define directories for "backup" and "undo" files. Check this protip if you are interested:

over 1 year ago ·