My computer crashed while in the middle of editing several vim files. Upon reboot, two of the files getting edited showed a file size 0 bytes. I was able to recover one of the .swp files with the :recover command. However, when I try to :recover on the other file I get so swap file found for .Organizer.pm.swp in the status line even though the file exists.

Is there anything else I can try?

  • Is there any data in the swap file? Or is it empty? You can also try recovering from a backup file, if you're storing those somewhere. May 23 '17 at 0:02
  • Actually, I just discovered that .Organizers.pm.swp (with an 's' at the end) exists which is another file. The one I need doesn't exist at all. Hopefully my TimeMachine backed it up recently.
    – StevieD
    May 23 '17 at 0:05
  • 1
    As a sidenote, personally I use set backup backupdir=$HOME/.vim/tmp/backup, which results in Vim perpetually keeping backups in the given directory on every write. It has saved a file three or four times from getting lost, not just from computer failures, but also from user errors ;-) May 23 '17 at 0:10
  • Thanks. Yeah, I think I'm screwed. I forgot this file was on a samba share so Time Machine didn't back it up. I don't get what happened, though. Every other file has a .swp file. The computer crashed instantly after I saved it with vim. So something screwy happened.
    – StevieD
    May 23 '17 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.