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:

GMO Root 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..

GMO Root 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..

Kreig Zimmerman said...

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

Blog Archive