Reference:
http://blog.csdn.net/lingdxuyan/article/details/4993868
Http://www.cnblogs.com/softwaretesting/archive/2011/09/23/2185851.html
About SWP files using VI, often can be seen. SWP this file, how is this file 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. 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
Of course you can use R key to recover.
If you do not want to save the SWP file every time vi crashes, you can disable the generation of SWP files by option
Set Noswapfile
Vim. swp file processing