Somelauw / evil-org-mode

Supplemental evil-mode keybindings to emacs org-mode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Key bindings are not available until state transition and are overridden.

crocket opened this issue · comments

Both README.org and doc/keythemes.org don't explain that navigation bindings are available only in motion mode.

I'd want to have navigation bindings in normal mode, too.

Unless evil has changed considerably, normal mode inherits from motion state.
So I don't understand why these keys aren't available to you.

normal/visual mode both inherit from motion mode.

Navigation keys becomes available once I enter insert mode and go back to normal mode.

Additional keys become available only after I enter insert mode and come back to normal mode.

I think this issue is emacs-evil/evil#301

Calling (evil-normalize-keymaps) after calling (evil-org-mode) in org-mode-hook works around the issue.

In order to avoid calling (evil-normalize-keymaps) in relevant hooks, replace
(evil-define-key 'motion evil-org-mode-map ...) with
(evil-define-minor-mode-key 'motion 'evil-org-mode ...) or
(evil-define-key 'motion 'evil-org-mode ...) in evil-org.el.

gk on motion mode from evil-org-mode is overridden with gk on normal mode from evil-collection-outline.el due to

(define-key org-mode-map [remap outline-backward-same-level]
  #'org-backward-heading-same-level)

in org-keys.el from org-plus-contrib. I use org-checklist from org-plus-contrib.

The same happens to gj and perhaps other keys, too.

In order to override all keybindings on org-mode major mode, bind keys on motion, normal, and visual states.