vi中wq和x之间的差异

时间:2012-12-12 16:24:02

标签: save vi quit

我总是使用:wq来保存文件。今天,我开始知道:x可以用来做到这一点。但我没有在任何vi-tutorial或vi-quick-reference中注意到它。这两个命令有什么区别吗?

1 个答案:

答案 0 :(得分:21)

来自

help :x

    *:x* *:xit*
:[range]x[it][!] [++opt] [file]
            Like ":wq", but write only when changes have been
            made.
            When 'hidden' is set and there are more windows, the
            current buffer becomes hidden, after writing the file.