Vim. swp file processing

Source: Internet
Author: User

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

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.