key bindings - Emacs: unbind all keys of some-mode-map -


i know, can unbind keys using unbind-key. in case have know key want unbind. don't know key. want unbind keys of some-mode-map. don't want override them, want unbind them , define own keys in some-mode-map. know iterate some-mode-map , apply unbind-key, may there more straightforward solution? , don't know how iterate keymap.

update

tried (as suggested phils in comments) way , didn't work:

(use-package neotree   :config   (setq neotree-mode-map (make-sparse-keymap))   (define-key neotree-mode-map (kbd "ret") 'neotree-enter) ) (use-package evil   :init   (setq evil-overriding-maps '((neotree-mode-map))) ) 

neotree-mode-map remains not cleaned. , depending on package configuration order, evil bindings gets overridden. doesn't unless redefine neotree-mode-map. know obtain desired result evil-define-key, want keep package specific settings in own configuration file. if employ evil-define-key, neotree key binding definitions in setup-evil.el , not in setup-neotree.el

update 2

answer works, (setq neotree-mode-map (make-sparse-keymap)). appears neotree-mode-map has parent map, , that's why key bindings "come back" after "cleaning". thing figured out is, evil put overriding maps information.

(keymap  ...  (override-state . all)  ... ) 

and that's why should clear map before evilconfiguration.

you can gut bindings in keymap following:

(setf (cdr <keymap>) nil) 

i think in practice want, because there'll bindings didn't realize useful (e.g. corresponding menubar entries), asked for.

as iterating keymap, can use map-keymap that.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -