I have this in my .vimrc
:
set directory=~/.vim/tmp-backup-swapfiles
This directory is read- and writable by me, sensibly enough. It is part of the local filesystem and never inaccessible.
However, vim seems to often ignore this and instead use ~/tmp
. I've sometimes thought it does this with files from a remote mounted filesystem, but since I do that much of the time it is hard to tell. Also, there are inconsistencies -- for example, right now I have gvim (7.4.475) open with a local file who's swap turns out to be in ~/tmp
and a remote file whose swap is in ~/.vim/tmp-backup-swapfiles
. It is easy to see they are both still in play by making a change to the buffer and checking the timestamp. I also have a source and header file from the same location open, but the .hpp.swp
is in ~/tmp
and the .cpp.swp
is in ~/.vim/tmp-backup-swapfiles
:\
This gets irritating when I have to clean up for whatever reason, or fail to, and get told there's suddenly a swapfile from last week in play on something I've been editing since. What can I do to force it to just use the one directory specified to ensure there's no confusion?