Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

`: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.



Thank-you. That beats `HdG :wq` to delete everything and abort the commit.


VCSs usually abort a commit if a temporary message file remains unmodified, so :q! is fine too.


Agreed. I use this all the time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: