Sometimes in vim, I accidentally type :Q instead of :q in normal mode. To work around this, I’ve added this in my .vimrc:
command Q q
This works fine for :Q, but in case I type :Q!, vim responds with “No ! allowed”. How do I make vim accept :Q! and interpret it as :q! ?
For more information, see
:help :command-bang.