unbind keys in Emacs

unbind keys in Emacs

August 15, 2023 | emacs, bookmark

tags
global-unset-key and local-unset-key are useful, but it’s worth having an answer to this question that points out that the general way to unbind a key (for any keymap) is to define a binding of nil:
(define-key KEYMAP KEY nil)
;; example
(define-key python-mode-map (kbd "C-c C-v") nil)
(global-unset-key (kbd "C-c C-v"));; unset python mode map

If you follow the code for either of those other functions, you’ll notice that this is exactly what they do.


No notes link to this note

Go to random page

Previous Next