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
snapplebobapple#
for me, I don't want it to write only when there are changes. I want it to error out if I try to quit without saving changes so I go and figure out if I changed something by accident before I save it and I want it to write specifically when I tell it to write. This cuts down on so many problems, at least in my use cases.
hosteur#
You can also just press ZZ in normal mode.
tasuki1 reply#
I'm rarely in a situation where I'd want to quit vim. One off config files on a remote machine perhaps?
anthomtb#
Config files on an embedded device got me into using vim 10+ years ago. This seems to be a common use case. Eg, “I use vim for short term editing on remote machines but VS Code for any serious editing.”

This is not me though. I love me a plug-in heavy vim for coding sessions. Maybe one of these days I’ll be stuck working with some ECMA-based language and will finally start using VS Code.

alexiaa#
I knew about `:x`, but I had no idea there was an actual distinction beyond just being a shortcut for `:wq`.

Load more comments