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

Show all comments

Showing thread 7 of 59

williamsmj3 replies#
`:cq` exits vim with exit code 1.

This is useful if you're in vim to write a git commit message and you realize don't actually want to commit. Or you're in vim from `fc` to edit a shell command and you realise you don't actually want to run it.

wruza#
VCSs usually abort a commit if a temporary message file remains unmodified, so :q! is fine too.
drudru#
Agreed. I use this all the time.
turtleyacht#
Thank-you. That beats `HdG :wq` to delete everything and abort the commit.