about VI Abnormal exit resulting from the SWP file
An. swp file is generated when you close the VI editor abnormally
About SWP file using VI, you can often see SWP this file, then how this file is generated, when you open a file, VI will generate such a. (filename) SWP file for contingency (discussed below), if you exit normally, then this SWP file will be automatically deleted. Here's the accident. Contingency is divided into: 1 when you use multiple programs to edit the same file. 2 non-regular exit. In the first case, in order to avoid producing two different versions of the same file (the exact words in vim), it is advisable to choose ReadOnly as well. In the second case, you can use vim-r filename to recover, and then delete the SWP file (this time to make sure your SWP file is useless, otherwise you will be sad)
The origin of the SWP file, when you forcibly close the VI, such as power suddenly broken or you use the CTRL+ZZ,VI automatically generated a. swp file, the next time you edit, there will be some hints.
You can use
Vi-r {your file name}
To recover the file, and then delete the SWP file with the following command, or you will always have this hint every time you edit it.
Rm. {Your file name}.swp
Found a similar hint on the Internet, different Linux hints may not be the same
". Xorg.conf.swp" Already exists!
[O]pen read-only, (E) dit anyway, (R) Ecover, (Q) Uit:
Of course you can use R key to recover.
VI Editor to exit normally you can use SHIFT-ZZ.
If you do not want to save the SWP file every time vi crashes, you can modify the file
About VI abnormal exit resulting from the SWP file