Often the mechanism to end up in the command line window is a transposition typo q: instead of :q when I intend to be closing Vim.

You can imagine the frustration at this point because the program state is now such that I have to (more carefully) type TWO more proper :q to achieve my goal. Although I do have, and can use a nice easy normal mode chord bind <s-q> for :q, my muscle memory and habits (using non-augmented vims) lead me to continue to use :q, so it is not a full solution.

In an effort to mitigate this situation, I have

nnoremap q: <Nop>

This works, however, now the q has an input delay (due to being bound now) and therefore causes the action of exiting from recording a macro/recording to be latent.

How can I remove my ability to enter the command line window without introducing such consequences?

  • :set timeoutlen=100...see if that helps
    – B Layer
    Jun 11, 2018 at 2:46
  • @BLayer I don't think I would want to do that, wouldn't that reduce my ability to execute any and all other multi-key binds??
    – Steven Lu
    Jun 11, 2018 at 4:03
  • Eh? Why would that be? It just reduces the delay. This is exactly what you'll find in $VIMRUNTIME/defaults.vim (and what I use on a daily basis).
    – B Layer
    Jun 11, 2018 at 7:52
  • Rather than type :q which can be messed up, learn to type ZZ and friends ZX,ZQ ? (I think I got those right)
    – D. Ben Knoble
    Jun 11, 2018 at 14:09
  • 1
    I agree with D. Ben, you may want to change your workflow a bit to avoid the situation and make a new habit. I personally use <c-w>c/:close instead of using :q. I find the commandline-window to be super useful and use it many times though out the day. I think it is up there with <c-x><c-e> in bash. Maybe it would be better to just map q and use getchar(). Jun 11, 2018 at 15:00

1 Answer 1


I have not found a way to disable the command-line window, but, I have eliminated the need for the q: bind of mine, by removing it and changing the rest of my vim config to allow my command-line window to work again as intended.

You could say this is solved by application of the XY problem principle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.