I don't want to have key 'u' bound to undo-tree-undo, as it's too conveniently dangerous to confuse with u for universal argument prefix.

I tried

(global-unset-key "u")

But it didn't have any effect. How can I achieve my goal?

Furthermore, the above code has a disasterous effect of redenring key 'u' not working at all. I could not even input letter 'u'.

Edit: based on Drew's suggestion, here is the likely relevant key map:

undo-tree-map is a variable defined in ‘undo-tree.el’.
Its value is shown below.

  This variable may be risky if used as a file-local variable.

Keymap used in undo-tree-mode.

Value: (keymap
 (24 keymap
     (114 keymap
          (85 . undo-tree-restore-state-from-register)
          (117 . undo-tree-save-state-to-register))
     (117 . undo-tree-visualize))
 (27 keymap
     (95 . undo-tree-redo))
 (67108927 . undo-tree-redo)
 (31 . undo-tree-undo)
 (67108911 . undo-tree-undo)
 (remap keymap
        (redo . undo-tree-redo)
        (undo-only . undo-tree-undo)
        (undo . undo-tree-undo)))

I still need help (an example) on how to manipulate it. Especially, how to translate the numbers to the key name to understand further how to modify.

  • Unbind it in the local keymap. Look for a keymap used by undo-tree - maybe undo-tree-mode-map or something.
    – Drew
    Aug 30 '17 at 23:42

Following Drew's advice, try this:

(unbind-key (kbd "u") evil-normal-state-map)

Here's how I found out which keymap to unbind it in: How can I find out in which keymap a key is bound?

  • Sorry, I made a mistake in clicking on the wrong button. But I cannot correct it. Really strange.
    – Yu Shen
    Nov 22 '17 at 20:39
  • click on up arrow doesn't work? maybe you have to click down arrow first? Dec 5 '17 at 16:56

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.