如果修改,则写入当前文件,并退出(与“:x”相同)。(注意:如果当前文件有多个窗口,则如果修改文件并关闭窗口,则写入该文件)。另一方面,WQ总是写入文件并退出VIM。
Write current file, if modified, and quit (same as ":x"). (Note: If there are several windows for the current file, the file is written if it was modified and the window is closed). :wq on the other hand always writes the file and quits Vim.
:wq 强制性写入文件并退出。即使文件没有被修改也强制写入,并更新文件的修改时间。
:x 写入文件并退出。仅当文件被修改时才写入,并更新文件修改时间,否则不会更新文件修改时间。
网友评论