Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs config. <escape> won't work #10

Closed
kuppo opened this issue Aug 18, 2021 · 1 comment
Closed

Emacs config. <escape> won't work #10

kuppo opened this issue Aug 18, 2021 · 1 comment

Comments

@kuppo
Copy link

kuppo commented Aug 18, 2021

Hello David,

It is a good and detailed guide and configuration of your Emacs.org. But I'm struggling with one of your configurations, namely (global-set-key (kbd "<escape>") 'keyboard-escape-quit). That I don't think it will work, since global-set-key will put the key binding into Emacs's global keymap which resides in a quite low precedence. You activated evil, and all evil's default keymaps reside in emulation mode keymap of Emacs which has higher precedence than global keymap.

Evil devises its own keymaps into hierarchy as well, all evil's state mode keymaps are basically in the evil global keymap, which in turn has relatively low precedence in evil's own keymap hierarchy. The <escape> key is mapped to evil-force-normal-state command in evil-normal-state-map. So evil's definition will intercept yours. You can use command-log-mode to see to which command exactly the key is bind.

You can use evil-define-key command to define your key binding again. This will put it into evil's axauliry keymap, which is higher than the evil global keymap. For me, evil-force-normal-state is not too useful when you are already in evil's normal state.

@daviwil
Copy link
Owner

daviwil commented Aug 19, 2021

Thanks for the feedback! This binding is mainly meant for exiting the minibuffer with ESC but honestly I almost never use it. I became much more used to pressing C-g instead. I'll probably just remove this binding!

@daviwil daviwil closed this as completed Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants