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