user181351
user181351

Reputation:

Can i stop vim creating the .swp swap files?

They are cluttering up my working dir. Maybe it could just put them in the vim directory or something?

Upvotes: 11

Views: 1642

Answers (4)

Tobarja
Tobarja

Reputation: 63

Using:

$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May  4 2012 04:25:35)
...

:help swapfile shows the command as: noswapfile

Upvotes: 4

Nicolas Kaiser
Nicolas Kaiser

Reputation: 1644

You can change the directory for swap files in .vimrc with

set directory=/tmp

See directory for more information.

Upvotes: 7

sehe
sehe

Reputation: 393934

As mentioned,

set noswap # in vimrc

:bufdo set noswap # when running

Or upon launch:

vim -n

Upvotes: 5

Rook
Rook

Reputation: 62588

You can disable it with

set noswap

in your _vimrc. As a matter of fact, that is the prefered behaviour when working with really large files. See more under :help swapfile

For settings them aside in a predefined directory, tis would be best to read a bit of this

Upvotes: 8

Related Questions