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-conventional exit.

The following information is prompted:

E325:attentionfound a swapfileBy the name". TEST.TXT.SWP"owned By:root dated:tue Mar2813: -: the  .        fileName:/tmp/test.txt modified:yes User name:root host name:test process ID:6855While openingfile "Test.txt"Dated:tue Mar -  -: -:Ten  . (1) Another program could be editing thesamefile. If this is the Case, be careful isn't to end up with different instances of the samefileWhen making changes. Quit,or continue with caution. (2) an edit session forThis filecrashed. If This is the Case, use": Recover"Or"Vim-rtest.txt"To recover the changes ( see": Help Recovery"). If you do this already, delete the swapfile ". TEST.TXT.SWP"To avoid the this message. Swapfile ". TEST.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) In order to avoid the creation of two different versions of the same file, it is recommended to 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 the unmodified, and then delete the SWP file (this time to make sure your SWP 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 retain the original modified content directly selected D can be.

(2) Want to retain 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.