Thursday, March 4, 2010

Vim unable to open swap file

If you see the following message when opening a vim file

Unable to open swap file for "{filename}", recovery impossible

The directory specified in your vim for swap files is missing. In my case it's ~/.vim/tmp.

# in .vimrc
set directory=~/.vim/tmp

mkdir -p ~/.vim/tmp

3 comments:

Unknown said...

In my case, this error was a symptom of a bigger problem..my Filesystem had ran out of inodes..
Vim was unable to create a swap file..

Unknown said...

In my case, this error was a symptom of a bigger problem..my Filesystem had ran out of inodes..
Vim was unable to create a swap file..

Unknown said...

Thanks for this. Not sure why this wasn't created by default for my Macintosh install of VIM but... shrug.

Blog Archive