Differences between ": wq" and ": x" in vim, vimwq

Source: Internet
Author: User

Differences between ": wq" and ": x" in vim, vimwq

From: http://www.apelearn.com/bbs/thread-7146-1-1.html


The differences between ": x" and ": wq" are as follows:
(1): wq is mandatory to write files and exit (Save the disk and exit write and quite ). Write the file forcibly even if it is not modified, and update the modification time of the file.
(2): x writes the file and exits. The file is written only when the file is modified, and the file modification time is updated; otherwise, the file modification time is not updated.
In general, the two are not the same, but programming may have an important impact on editing source files. Because even if the file is not modified, ": wq" forcibly updates the file's modification time,
This will enable make to compile the entire project and assume that the file has been modified, and then re-compile the link to generate an executable file. This may cause people to misunderstand the consequences. Of course, it also produces unnecessary system resource costs. However, software such as version control usually prefers to compare the file content. The modification time is usually ignored.

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.