The difference between ": Wq" and ": X" in Vim

Source: Internet
Author: User

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


The differences between ": X" and ": Wq" are as follows:
(1): Wq Mandatory Write file and exit (save and exit write and quite). Force write even if the file is not modified, and update the file's modification time.
(2): x write to File and exit. Writes only when the file is modified and updates the file modification time, otherwise the file modification time is not updated.
The two are generally not the same, but in terms of programming, editing the source file can have a significant impact. Because the file is not modified, ": Wq" forces the update of the file when it is modified,
This will allow make to compile the entire project and assume that the file has been modified, and then recompile the chain to deliver the executable file. This can have misleading consequences and, of course, unnecessary system resource costs. But like version control software generally preferred or compare file content, modification time is generally ignored.

The difference between ": Wq" and ": X" in Vim

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.