JorisE / evil-mu4e

Evil keybindings for mu4e

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Marking headers broken

ddoherty03 opened this issue · comments

I just tried enabling evil-mu4e, and I like it a lot. I have noticed, though, that marking a region in headers view does not work. It is mapped to evil-delete instead of mu4e-headers-mark-for-trash. Thus, you get a message that the buffer is read-only. I suspect this is a symptom of a wider problem with keys that are not explicitly mapped in evil-mu4e: they fall back to evil-mode keybindings instead of mu4e keybindings.

Also, what is the status of this with respect to getting included in the mu4e layer for spacemacs?

Regards,

Tnx, I like it too :). That being said, it may be that evil-mu4e in its current state is less than ideal for anyone that does not use pretty much the same workflow that I use. As you note, evil-mu4e currently falls back to evil instead of mu4e. I don't know that I ever thought about in that way. If the other way around is just as easy that might make more sense.
All of the above being said, if you send a pull request to fix the functionality that you are missing, I'll promptly merge that in.

Also, what is the status of this with respect to getting included in the mu4e layer for spacemacs?

There has been a PR open for more than a year, I have asked around on Gitter, but I don't think mu4e is receiving as much love (in Spacemacs and in general :p) as it deserves.

@JorisE, Thanks for the reply. I have worked around the keybinding issues in spacemacs by just rolling my own and installing mu4e apart from spacemacs. I was a long-time user of Wanderlust, but it seems not to get a lot of love either. When I abandoned running my own email server for the convenience of gmail, I just started using the gmail web interface, but I missed having emacs as my email editor. I am in the midst of switching to spacemacs and getting my fingers back to their long-lost vim (maybe 13 years) muscle memory. I have been trying also to sync only with gmail's "All Mail" folder and using labels only for organizing my email. So far, not bad.

For those interested, here is the core of my mu4e config, suggested by Aaron Bieber here. It just puts all mu4e buffers into evil-emacs-state, then adds vim-esque bindings on top of that, plus a few others to replace those mu4e bindings displaced by the vim ones:

(spacemacs/set-leader-keys "a M" 'mu4e)
(global-set-key (kbd "C-x m") 'mu4e-compose-new)
(message "Adding mu4e modes to emacs state")
(add-to-list 'evil-emacs-state-modes 'mu4e-main-mode)
(add-to-list 'evil-emacs-state-modes 'mu4e-headers-mode)
(add-to-list 'evil-emacs-state-modes 'mu4e-view-mode)
(message "Done adding mu4e modes to emacs state")
(evil-add-hjkl-bindings mu4e-main-mode-map 'emacs
  (kbd "J") 'mu4e~headers-jump-to-maildir
  (kbd "/") 'evil-search-forward)
(evil-add-hjkl-bindings mu4e-headers-mode-map 'emacs
  (kbd "g") (make-sparse-keymap)
  (kbd "gg") 'beginning-of-buffer
  (kbd "gr") 'mu4e-headers-rerun-search
  (kbd "G") 'end-of-buffer
  (kbd "j") 'mu4e-headers-next
  (kbd "k") 'mu4e-headers-prev
  (kbd "C-j") 'mu4e-headers-next-unread
  (kbd "C-k") 'mu4e-headers-prev-unread
  (kbd "n") 'mu4e-view-search-narrow
  (kbd "J") 'mu4e~headers-jump-to-maildir
  (kbd "TAB") 'mu4e-select-other-view
  (kbd "/") 'evil-search-forward)
(evil-add-hjkl-bindings mu4e-view-mode-map 'emacs
  (kbd "g") (make-sparse-keymap)
  (kbd "gg") 'beginning-of-buffer
  (kbd "gr") 'mu4e-update-mail-and-index
  (kbd "G") 'end-of-buffer
  (kbd "M-SPC") 'mu4e-scroll-up-or-next
  (kbd "C-j") 'mu4e-view-headers-next
  (kbd "C-k") 'mu4e-view-headers-prev
  (kbd "n") 'mu4e-view-search-narrow
  (kbd "J") 'mu4e~headers-jump-to-maildir
  (kbd "y") 'mu4e-view-save-url
  (kbd "TAB") 'mu4e-select-other-view
  (kbd "/") 'evil-search-forward)

I also keep the SPC key as the leader key:

(with-eval-after-load 'mu4e
  (define-key mu4e-main-mode-map
    (kbd dotspacemacs-leader-key) spacemacs-default-map)
  (define-key mu4e-headers-mode-map
    (kbd dotspacemacs-leader-key) spacemacs-default-map)
  (define-key mu4e-view-mode-map
    (kbd dotspacemacs-leader-key) spacemacs-default-map))

#14 does not fix it yet, but I'll work on it.

It should be OK now. Feel free to re-open if there is any issue.