On Fri, Nov 07 2014 (17:59), Alexander Shukaev <[email protected]> wrote:
I have 2 questions on Evil:
1. How to wipe out all the default key maps which are present in `evil-maps.el' preferably with as few calls as possible? Note that I'm aware of how to do that with 1 by 1 `undefined' assignmetns, but I'm looking for something simpler.
Just override the variables: (dolist (map '(evil-normal-state-map evil-emacs-state-map evil-visual-state-map evil-insert-state-map)) (set map (make-sparse-keymap))) There are some maps missing, (apropos "evil.*state-map") will show them to you. Just add those to the list if you want to reset all.
2. Is this
(evil-define-key 'normal global-map (kbd "<left>") 'do-something)
indentical to
(define-key evil-normal-state-map (kbd "<left>") 'do-something)
?
No. The former defines a mapping in an additional keymap for the normal state when `global-map' is active. The latter defines a mapping in the normal state map. This is not only a technical detail but has also consequences on the priority of the mapping (i.e. which definition would shadow). For (evil-)global mappings the latter is preferable, for mode local, e.g. for org-mode, the former is the way to go. Michael