From b5f258914d60872a66dc41b15513e64731517674 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 6 Mar 2021 00:06:14 -0500 Subject: [PATCH] app/calendar: add evil keybind scheme This should probably be upstreamed to evil-collection. Fixes #4019 --- modules/app/calendar/config.el | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/modules/app/calendar/config.el b/modules/app/calendar/config.el index 9d49759ad..e587961c5 100644 --- a/modules/app/calendar/config.el +++ b/modules/app/calendar/config.el @@ -25,6 +25,46 @@ (set-popup-rule! "^\\*cfw:details" :quit t :ttl 0 :select t :size 0.4) (define-key cfw:calendar-mode-map "q" #'+calendar/quit) + (when (featurep! :editor evil +everywhere) + (set-evil-initial-state! '(cfw:calendar-mode cfw:details-mode) 'motion) + (add-hook! (cfw:calendar-mode cfw:details-mode) #'evil-normalize-keymaps) + (map! (:map cfw:calendar-mode-map + :m "q" #'+calendar/quit + :m "SPC" #'cfw:show-details-command + :m "RET" #'cfw:show-details-command + :m "TAB" #'cfw:navi-prev-item-command + :m [tab] #'cfw:navi-prev-item-command + :m [backtab] #'cfw:navi-next-item-command + :m "$" #'cfw:navi-goto-week-end-command + :m "." #'cfw:navi-goto-today-command + :m "<" #'cfw:navi-previous-month-command + :m ">" #'cfw:navi-next-month-command + :m "C-h" #'cfw:navi-previous-month-command + :m "C-l" #'cfw:navi-next-month-command + :m "D" #'cfw:change-view-day + :m "M" #'cfw:change-view-month + :m "T" #'cfw:change-view-two-weeks + :m "W" #'cfw:change-view-week + :m "^" #'cfw:navi-goto-week-begin-command + :m "gr" #'cfw:refresh-calendar-buffer + :m "h" #'cfw:navi-previous-day-command + :m "H" #'cfw:navi-goto-first-date-command + :m "j" #'cfw:navi-next-week-command + :m "k" #'cfw:navi-previous-week-command + :m "l" #'cfw:navi-next-day-command + :m "L" #'cfw:navi-goto-last-date-command + :m "t" #'cfw:navi-goto-today-command) + (:map cfw:details-mode-map + :m "SPC" #'cfw:details-kill-buffer-command + :m "RET" #'cfw:details-kill-buffer-command + :m "TAB" #'cfw:details-navi-prev-item-command + :m [tab] #'cfw:details-navi-prev-item-command + :m [backtab] #'cfw:details-navi-next-item-command + :m "q" #'cfw:details-kill-buffer-command + :m "C-h" #'cfw:details-navi-prev-command + :m "C-l" #'cfw:details-navi-prev-command + :m "C-j" #'cfw:details-navi-next-command + :m "C-k" #'cfw:details-navi-prev-command))) (add-hook 'cfw:calendar-mode-hook #'doom-mark-buffer-as-real-h) (add-hook 'cfw:calendar-mode-hook 'hide-mode-line-mode)