Last Updated: February 25, 2016
·
849
· 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: http://web.cs.swarthmore.edu/help/vim

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: https://coderwall.com/p/sdhfug?i=3&p=1&q=author%3Arbika&t%5B%5D=rbika.

over 1 year ago ·