In Visual mode, after selecting text, the u key will convert the selection to all-lowercase. This is a problem as my camelCase
text silently gets changed to lowercase
, and I don't realize that it happened until it's no longer helpful to undo. I want to unmap this behavior, but because it's a built-in command I can't seem to figure out how to do it.
1 Answer
As it's an internal mapping, you won't be able to unbind
the combo; however, you can remap it to a <Nop>
so that the keypress does nothing. You can do this with the following command:
:map u <Nop>
Or, if you want it to apply to visual mode only (recommended, since u in normal mode is the undo action), you would run this command:
:vmap u <Nop>
If the above commands produce results you want, you can add one to your .vimrc
file (usually found in ~/.vimrc
) to make the setting permanent. For additional reading, I would look at this answer to look which exact remap option to add.
vmap u <nop>
Also read:h map
.