Lurker News
`:x` leaves the modification time of files untouched if nothing was changed.

    :help :x
        Like ":wq", but write only when changes have been made.

Comments (270) 59 threads

Earlier comments
jrochkind11 reply#
I barely ever use vi(m), but occasionally use it when I have to or it's convenient for me to edit something at a CLI only, which in my work practice is only an occasional brief thing.

`:x` is one of only like 8 commands I know!
I'm surprised that it's apparently not one of the basic commands everyone knows?

MayeulC#
It's pretty well-known (a bit less than :wq though).

What most didn't know (myself included) is that the behavior is slightly different from wq.

seanhunter#
Seriously. Just type Shift-double-z in normal mode. No colon, no fuss, no mistakes, no confusion with anything else. No need to remap in case you press shift, because you press shift on purpose. Works everywhere vim is installed, even if your dotfiles aren’t.
mmastrac1 reply#
I learned early on that the easiest way to quit Vim without saving was ctrl-Z and then kill -9 %1
bradwood1 reply#
You could just reboot.

Load more comments