I don't look at my keyboard when I type (I don't think a lot of people do these days) and I catch myself occasionally pressing 'u' in visual mode by mistake.

This causes all the text in a visual bloc to go lower case.

It's happened multiple times and I would really want to disable this functionality. I am aware that I can use ~ to change case.

How can I disable u during visual mode (lowercasing) but not u (undo)?


You can map u to a no-op in visual mode with the following.

:vmap u <Nop>

That won't affect the behavior of u in normal mode. See

:help <Nop>
:help map-modes
  • 2
    That should be visual and select mode. xmap is visual mode only.
    – Herb
    Jan 22 '18 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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