An abnormal shutdown of the VI editor will generate a. swp file about SWP file Use VI, often can see SWP this file, that this file is how to produce it, when you open a file, VI will generate such a. (filename) SWP file for contingency (rainy below discussion), if you exit normally, then this SWP file will be automatically deleted. The following said that the accident. Accidents are divided into: 1 when you use multiple programs to edit the same file. 2 non-regular exits. In the first case, to avoid having two different versions of the same file (the exact words in vim), it is advisable to choose ReadOnly. In the second case, you can use vim-r filename to restore, and then delete the SWP file (this time to ensure that your SWP file is useless, or you will be sad)
SWP file History, when you forcibly shut down VI, such as power suddenly broke off or you use the CTRL+ZZ,VI automatically generate a. swp file, the next time you edit, there will be some prompts.
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 prompt for each edit.
Rm. {Your file name}.swp
A similar hint was found on the web, and different Linux hints might 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 the R key to recover.
VI Editor to exit normally, you can use Shift-zz.
[SuSE] The Resolved VI command generates a. swp file-related issues-> example: A. a.dat.swp file is generated when using VI a.dat
then open a terminal VI A.D At is prompted:
"Swap file". FileName. SWP "Already exists![ O]pen read-only, (E) dit anyway, (R) Ecover, (Q) uit: "
-> VI version:
vi-vierson
   VIM-VI Improved 6.3 (June 7, compiled Oct 23:12:36)
;
-> asks: (vi a file how can not let it produce. swp file.
or don't let him hint "Swap file". FileName. SWP "Already exists! [O]pen read-only, (E) dit anyway, (R) Ecover, (Q) uit: ")
Processing method: Open/ETC/VIMRC and add set Noswapfile after OK