Question

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?

Was it helpful?

Solution

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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top