ex-mode
ex-mode copied to clipboard
Implement :x rigorously
Shouldn't update mtime when no changes were made, whereas :w
always writes (so, touches the file).
For reference:
:[range]x[it][!] [++opt] [file]
Like ":wq", but write only when changes have been made.
Also, some peculiarities:
$ vim foo bar
:xa
# exits and nothing written
$ vim foo bar
:x
# warns and nothing written
$ vim foo bar
:wqa
# weirdly, exits and nothing written
$ vim foo bar
:wq
# writes foo, then warns