You are not logged in.

#1 2018-12-08 23:08:26

pdxleif
Member
Registered: 2011-10-26
Posts: 5

vim: unable to open swap file, recovery impossible.

As of a few days ago, I get that message every time I open a file in vim, I get that error about "unable to open swap file", and then when I try to save a file, it tells me "E510: Can't make backup file (add ! to override)", so I have to use "w!" to get past that.
I've uninstalled vim / gvim, rm -r'd the /usr/share/vim directory in between doing that, but it still happens.
My /home is btrfs. If I edit a file on /tmp, I still get that opening message about unable to open swap, but I don't get the error about "Can't make backup file" when saving.

Edit: false alarm - it turned out my $HOME/.cache filesystem was hosed, and vim has ~/.cache/vim/backup// set as the backupdir by default. (according to :se backup? backupdir? backupext?) The filesystem was unrecoverable, so I recreated it.

Last edited by pdxleif (2018-12-08 23:40:40)

Offline

#2 2018-12-09 00:05:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 20,436
Website

Re: vim: unable to open swap file, recovery impossible.

Please remember to mark your thread as SOLVED.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2018-12-09 00:57:16

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,535

Re: vim: unable to open swap file, recovery impossible.

By default, Arch Linux's configuration will set the backup, swap, and undo directories to subdirectories of ${XDG_CACHE_HOME:-$HOME/.cache} for security reasons.

BTW why is that "filesystem" hosed? Usually the cache directory is the one XDG directory you do not share... the only other thing I can think of people doing to it is mounting it as a tmpfs, which shouldn't be getting hosed, but recreated...

Last edited by eschwartz (2018-12-09 00:59:31)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB