Workaround for incorrect prompt after turning off vim editor

Source: Internet
Author: User

with vim, there are two common causes of errors:

(1) when you use multiple programs to edit the same file.

(2) non-regular exit.

The following information is prompted:

E325: attentionfound a swap file by the name ". Old.txt.swp"           owned by: root   dated: tue mar  2813:27:34 2017        file name: /tmp/old.txt          modified: YES         user name: root   host name:oldboy38        process ID: 6855While opening file  "Old.txt"               dated: tue mar 28 13:27:10 2017   (1)  Another program may be editing thesame file.  If  This is the case,   be careful not to end up with  two different iNstances of the same   file when making changes.  quit, Or continue with caution. (2)  an edit session for this filecrashed.   if this is  the case, use  ": Recover"  or  "Vim -rold.txt"    to  recover the changes  (see  ": Help recovery").    if you did  this already, delete the swap file  ". Old.txt.swp"    to  avoid this message. swap file  ". Old.txt.swp" already exists! [o]penread-only,  (E) dit anyway,  (R) ecover,  (D) elete it,  (Q) uit,  (A) bort:

(1) (2) for the official solution:

(1) to avoid creating two different versions of the same file, it is recommended that you select "(Q) uit" or continue to carefully modify the selection "(E) dit anyway".

(2) You can also select "(R) ecover" or "vim-r filename" to revert to unmodified before deleting the SWP file (this time make sure your SWP the file is useless).

The meaning of the following option:

    • O: read-only, cannot be changed

    • E: can be changed, the previous changes have been lost

    • R: Restore ( previous modification )

    • D: by deleting ( deleting . SWP file, file recovery before modification )

    • Q: Exit

    • A: Give up

Specific solutions:

(1) do not want to keep the original modified content directly select D .

(2) want to keep the original modified content select R to copy the modified content to save, and then exit the file delete awp file. (the AWP file defaults to hidden files, and is viewed with the ls-a command and deleted with the RM command.) )


Workaround for incorrect prompt after turning off vim editor

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.