I'm trying to unmap the normal mode open cmdline-window bindings:

nnoremap q: <NOP>
nnoremap q? <NOP>
nnoremap q/ <NOP>

Do not have any effect, even though :verbose map q: shows it's correctly mapped to <Nop> in normal mode.

n  q:          * <Nop>                  

When I press q: it still opens the command line window.

How can I stop q: etc. from doing anything?

1 Answer 1

  1. q:, q?, and q/ are not mappings so they can't be "unmapped" (or "remapped").

  2. Mapping a built-in command to <NOP> is the correct way to get rid of it.

  3. Your mappings should work as intended in $ vim -Nu NONE and $ vim --clean (they do, here). If they do, it means that the mappings themselves are correct but something in your config is interfering, which means that you will have to debug it.

  • How can I debug this? The output of :verbose map q: is identical in my vim that has loaded my config, and one that hasn't but where I have run :nnoremap q: <NOP>. I have no idea what else could be affecting this behaviour Apr 3 at 11:57
  • I have no idea either and your config is out of reach so I can't really help beyond vague indications. What we do in those cases is a bisection.
    – romainl
    Apr 3 at 13:23

Your Answer

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

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