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.