Globally override key binding in Emacs

后端 未结 8 2154
栀梦
栀梦 2020-11-22 06:51

How can I set a key binding that globally overrides and takes precedence over all other bindings for that key? I want to override all major/minor mode maps and make sure my

8条回答
  •  一向
    一向 (楼主)
    2020-11-22 07:41

    I found this question while searching for "emacs undefine org mode keybindings", because I wanted to unbind the existing C-c C-b behavior to allow my global map to bury-buffer to work in an org buffer.

    This ended up being the simplest solution for me:

    (add-hook 'org-mode-hook
          (lambda ()
            (local-unset-key (kbd "C-c C-b"))))
    

提交回复
热议问题