[notmuch] Improve evilification and documentation

notmuch-hello was using an evilified buffer which broke the embedded search
widget in the buffer. I have changed the evilification to using normal mode
with manual bindings instead.

In addition I have made the notmuch message buffer closable using "q"
and added the missing notmuch-hello keybindings to the docs.
This commit is contained in:
Maximilian Wolff 2020-03-15 23:58:23 +01:00
parent dc0a1246cc
commit 83fbc7a13e
No known key found for this signature in database
GPG Key ID: 2DD07025BFDBD89A
2 changed files with 37 additions and 9 deletions

View File

@ -132,10 +132,20 @@ Refer to the official notmuch website for more information:
** Evilified key bindings
*** Hello mode
| Key binding | Command |
|-------------+-----------------------------|
| ~J~ | Jump to a saved search |
| ~s~ | Show threads matching QUERY |
| Key binding | Command |
|-------------+--------------------------------------|
| ~TAB~ | Jump to next widget |
| ~S-TAB~ | Jump to previous widget |
| ~J~ | Jump to a saved search |
| ~s~ | Show threads matching QUERY |
| ~=~ or ~g~ | Refresh buffer |
| ~M-=~ | Refresh all open notmuch buffers |
| ~?~ | Open notmuch help buffer |
| ~G~ | Pull new messages and refresh buffer |
| ~m~ | Open new mail buffer |
| ~q~ | Kill notmuch buffer |
| ~v~ | Show current notmuch version |
| ~z~ | Open notmuch tree buffer |
*** Search mode

View File

@ -16,8 +16,8 @@
notmuch
org
persp-mode
window-purpose
))
window-purpose))
(defun notmuch/init-counsel-notmuch ()
(use-package counsel-notmuch
@ -80,9 +80,27 @@
"Po" 'spacemacs/notmuch-show-open-github-patch
"Pa" 'spacemacs/notmuch-git-apply-patch
"PA" 'spacemacs/notmuch-git-apply-patch-part)
;; evilified maps
(evilified-state-evilify-map notmuch-hello-mode-map
:mode notmuch-hello-mode)
;; Evilify notmuch modes
;; Use normal mode map to allow proper editing capabilities
;; for the embedded search field in `notmuch-hello-mode`
(evil-set-initial-state 'notmuch-hello-mode 'normal)
(evil-define-key 'normal notmuch-hello-mode-map
"C-tab" #'widget-backward
"S-tab" #'widget-backward
"=" #'notmuch-refresh-this-buffer
"?" #'notmuch-help
"G" #'notmuch-poll-and-refresh-this-buffer
"g" #'notmuch-refresh-this-buffer
"J" #'notmuch-jump-search
"m" #'notmuch-mua-new-mail
"q" #'notmuch-bury-or-kill-this-buffer
"s" #'notmuch-search
"v" #'notmuch-hello-versions
"z" #'notmuch-tree
"M-=" #'notmuch-refresh-all-buffers)
;; Make notmuch message mode exitable with q
(evil-define-key 'normal notmuch-message-mode-map
"q" #'message-kill-buffer)
(evilified-state-evilify-map notmuch-show-mode-map
:mode notmuch-show-mode
:bindings