Skip to content
Micha Niskin edited this page Jan 9, 2015 · 2 revisions

Swap Files

The default behavior of Vim is to create swap files in the same directory as the file you're editing. These files will be hidden files with the .swp, .swo, .swn, ... extensions. These files can be problematic for boot tasks and can trigger unnecessary builds and are generally a hassle to deal with.

You can change this behavior in your ~/.vimrc file by setting the following options:

set backup
set swapfile
set backupdir=~/.vim-tmp
set directory=~/.vim-tmp

This tells Vim to create its swap files in the ~/.vim-tmp directory instead.

Clone this wiki locally