From f2ec3982d237cf233ec4ab94c07f804c1d6ad9bd Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Thu, 10 Oct 2024 07:48:29 +0100 Subject: [PATCH] fix(emacs): ensure org-agenda uses the general leader keybindings When in org agenda mode you can't use the leader to access all the key beginning that has been setup up by general. I use this quite a lot to quickly navigating to other notes or the email inbox. This adds a hook to run after org agenda so the evil mode is normal not emacs. This will allow the general keybindings to be used in that buffer. --- site-modules/core/files/emacs/init.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/site-modules/core/files/emacs/init.el b/site-modules/core/files/emacs/init.el index c2eb510..8e0dee8 100644 --- a/site-modules/core/files/emacs/init.el +++ b/site-modules/core/files/emacs/init.el @@ -299,12 +299,21 @@ just in in the current buffer." (use-package evil-org :straight t - :after org + :after evil org :hook (org-mode . (lambda () evil-org-mode)) :config (require 'evil-org-agenda) + (evil-org-set-key-theme) (evil-org-agenda-set-keys)) +;; Ensure org-agenda starts in evil-normal-state +(defun aa/org-agenda-setup () + "Start org-agenda in evil-normal-state." + (evil-org-mode) + (evil-set-initial-state 'org-agenda-mode 'normal)) + +(add-hook 'org-agenda-mode-hook 'aa/org-agenda-setup) + ;;; Email (use-package counsel-notmuch