app/calendar: add evil keybind scheme

This should probably be upstreamed to evil-collection.

Fixes #4019
This commit is contained in:
Henrik Lissner 2021-03-06 00:06:14 -05:00
parent 4003d1fdea
commit b5f258914d

View file

@ -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)