tags:

views:

207

answers:

3

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?

+9  A: 

The "combo" is Q. To disable it, simply map Q to something else:

:map Q <whatever>

I use gq, which is used to format text.

If you don't want it do do anything map it to <Nop>:

:map Q <Nop>
Martinho Fernandes
+1  A: 

If you don't want to map it to something else, just use :unmap. If you do have something else in mind, :map will work - take a look at the help pages to see the variations to specify what modes the map will be used in.

Jefromi
`:unmap` does remove mappings, but won't remove the defaults, like in this case.
Martinho Fernandes
Ah, my bad. Thought I remembered it working there too.
Jefromi
I thought the same at first. My answer was originally mentioning `:unmap`, like yours, but then I tried it in my vim and only then I realized it didn't work.
Martinho Fernandes
+7  A: 

<Nop> is meant for use in mapping keys to "nothing". See :h <Nop>.

:map Q <Nop>
Brian Carper