tags:

views:

169

answers:

2

Hello,
I'm working at a project on a remote server. I don't want to have the swap files on the server. I would like all swap files for Vim (and, of course, gVim) to be saved on the specified directory. How could I do that?

+2  A: 

Looks like you need to set the directory option:

http://vimdoc.sourceforge.net/htmldoc/options.html#%27directory%27

http://vimdoc.sourceforge.net/htmldoc/recover.html#swap-file

toolkit
Thanks. I found what I needed in the second link you provided: :set dir=~/tmp (I'm on linux)
sica07
A: 

You might want to consider setting the backupdir options as well:

set backupdir=Z:\backups

That makes vim store backups in a specific location rather than in the current directory.

Benj
Thanks. I didn't know about this either.
sica07