Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

While I am editing my httpd.conf file the vim editor get closed abruptly. now when i am trying to open that file again editor says " want to restore or Abort or cancel. After doing this one of the task it opens the file. Then I close the file normally.

Now when I am again going to open this file it again asks to restore. and changes are not saved properly.

What shall i do?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Vim uses a swap file system to maintain a constant state of the file you're working on in case Vim crashes, the computer loses power, etc.

Vim deletes the .swp file when it closes, and so you should only be seeing this message if vim was shut down abruptly, or if another vim is open somewhere.

(R)ecover: will open the file based on what's in the swap - Useful if vim or your computer has crashed. The contents of the file will look like what it did when vim was last opened.

(E)dit Anyway: will open the file based on what's actually in the file. The contents of the file will look like whatever was last saved.

When you see this message, you should use ls -a to show the swp file, and delete it with rm .the-name.swp.

share|improve this answer
add comment

You'll read the rest of the message and realize that it wants you to delete the file that starts with a . and ends with a .swp.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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