I was remotely editing a new file: man-01-Intro.txt but the machine went down before I wrote it to disk so only the swp version was conserved. Is there anything that I can do to recover the work already done?

I'm using Vim 7.4.273

1 Answer 1


Edit the same file again. Vim will prompt you with a few options; say you want to Recover. Then save the file, quit Vim, and remove the swap file (otherwise Vim will prompt you again the next time you edit the same file). The result may or may not have your latest edits, but it's better than nothing. Do check that everything is ok.

  • I tried before asking. The problem is that the text file never was created, so vim identifies it as a new file and the .swp file is not recognized. NOT You are right: I was trying a different directory. Solved! Thanks. Commented Sep 10, 2016 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.