Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make :Q! have the same functionality as :q! in vim

Tags:

vim

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! ?

like image 858
Alexandros Avatar asked Mar 25 '11 15:03

Alexandros


1 Answers

:command -bang Q quit<bang>

For more information, see :help :command-bang.

like image 70
Markus Jarderot Avatar answered Oct 16 '22 02:10

Markus Jarderot