Below is the entirety of my Evil key bindings in init.el
:
(evil-define-key 'normal 'global (kbd "SPC") (make-sparse-keymap))
(evil-define-key 'normal 'global (kbd "SPC TAB") #'ivy-switch-buffer)
(evil-define-key 'normal 'Info-mode-map (kbd "SPC") (make-sparse-keymap))
(evil-define-key 'normal 'Info-mode-map (kbd "SPC SPC") #'Info-scroll-up)
The end result of this is as follows:
- In
Emacs-Lisp
mode,SPC TAB
is bound toivy-switch-buffer
; this is expected. - In
Emacs-Lisp
mode,SPC SPC
is bound toInfo-scroll-up
; this is unexpected. - In
Info
mode,SPC TAB
is undefined; this is unexpected. - In
Info
mode,SPC SPC
is bound toInfo-scroll-up
; this is expected.
It seems to me (in one sentence) that the global config is not global and the local config is global. This is the opposite of what I would expect.
The Info-scroll-up
binding is defined on Info-mode-map
and has effect even when Info
mode is not active. Why?
The ivy-switch-buffer
binding is defined globally, but does not work when I am in Info
mode. Not only does it not work, but it is undefined. It's not that SPC TAB
has been replaced by another command, SPC TAB
is undefined (and SPC
is a prefix key). Why?
I can't form any mental model of why Evil / Emacs is behaving this way. Why is it behaving this way?