I have a keyboard with an undo key right next to the esc key. I often miss esc, hit undo, which causes the vim process to be stopped. How can I remap the undo key in vim such that it doesn't do anything? I know how to map keys in vim, but I can't make it work for this particular key.
You can get the character(s) that this key sends by using
<C-v>[key] in commandline or insert mode; for example
This will probably be multiple characters starting with the escape character (
^[). You can then map this to
nnoremap <Esc>OP OP <Nop>
This example is F1 on my system.
<Esc>; you can also use the literal escape character, but that can be a bit awkward to edit.