Re-init custom keys after evil-org-set-key-theme

evil-org-set-key-theme blanks out evil-org-mode-map, undoing all our
custom keybinds. Using it isn't the correct way to customize evil-org,
but it is understandable people would use it expecting it to be, so
`+org|setup-evil` will now run after it is called.

The "Doom" way to customize evil-org would be to modify the
`evil-org-key-theme` variable, but with this change, either will work.
This commit is contained in:
Henrik Lissner 2018-06-04 17:47:46 +02:00
parent f7a6089956
commit 8cf407caff
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -22,11 +22,13 @@
(def-package! evil-org
:when (featurep! :feature evil +everywhere)
:hook (org-mode . evil-org-mode)
:hook (org-load . evil-org-set-key-theme)
:init
(setq evil-org-key-theme '(navigation insert textobjects))
(add-hook 'org-load-hook #'+org|setup-evil)
(add-hook 'evil-org-mode-hook #'evil-normalize-keymaps))
(add-hook 'evil-org-mode-hook #'evil-normalize-keymaps)
:config
;; in case it is called later
(advice-add #'evil-org-set-key-theme :after #'+org|setup-evil))
(def-package! evil-org-agenda
:when (featurep! :feature evil +everywhere)
@ -265,7 +267,7 @@ between the two."
[remap doom/backward-to-bol-or-indent] #'org-beginning-of-line
[remap doom/forward-to-last-non-comment-or-eol] #'org-end-of-line))
(defun +org|setup-evil ()
(defun +org|setup-evil (&rest _)
(require 'evil-org)
;; By default, TAB cycles the visibility of all children under the current
;; tree between three states. I want to toggle the tree between two states,