I always using :wq to save a file. Today, I came to know that :x can be used to do that. But I didn't notice it in any vi-tutorial or vi-quick-reference. Is there any difference between these two commands?

有帮助吗?

解决方案

From

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.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top