Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .