I get the following 10X times a day by accident.
Entering Ex mode. Type "visual" to go to Normal mode.
How can you disable the combo which causes it in Vim?
To leave Ex mode you have to type :visual . To enter it, you type Q , which some people hit accidentally and consider an annoyance. Scripts sometimes use Ex mode, and plugin authors occasionally use it to try out snippets of Vim script. Many people use Vim for years without using it at all, and some even remap Q .
The Ex mode is similar to the command line mode as it also allows you to enter Ex commands. Unlike the command-line mode you won't return to normal mode automatically. You can enter an Ex command by typing a Q in normal mode and leave it again with the :visual command.
<Nop>
is meant for use in mapping keys to "nothing". See :h <Nop>
.
:map Q <Nop>
Or put it in your ~/.vimrc
:
map Q <Nop>
.
This answer is based on @NielsBom's comment 4. October 2012 and on @BrianCarper's answer 13. August 2009.
I think NielsBom is completely right, please see the article. The command map
is really evil in Vim and has caused me a lot of problems during years. I did not realize the thing before NielsBom's comment. So please use the following command instead:
:nnoremap Q <Nop>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With