Skip to content

Commit

Permalink
mu4e: revert back bindings to SPC a M and change helm-mu bindings
Browse files Browse the repository at this point in the history
Use major-mode specific key bindings for helm-mu commands.
  • Loading branch information
syl20bnr committed Jan 20, 2018
1 parent 7487ca5 commit 0b484bc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
9 changes: 6 additions & 3 deletions layers/+email/mu4e/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This layer adds support for the Mu4e email client.
- Search-based: no folders, only queries.
- UI optimized for speed: quick keystrokes for common actions.
- Very extendable and costumizable.
- Integration with Helm.

* Install
In order to use this layer you must install mu and mu4e separately. Typically
Expand Down Expand Up @@ -54,9 +55,11 @@ existing =dotspacemacs-configuration-layers= list in this file.
* Commands
** Global bindings

| Keybinding | Command |
|------------+------------|
| ~SPC a M~ | Start mu4e |
| Keybinding | Command |
|------------------------+---------------------------------|
| ~SPC a M~ | Start mu4e |
| ~SPC m S~ or ~SPC m /~ | Search emails (requires helm) |
| ~SPC m C~ | Search contacts (requires helm) |

** Headers mode

Expand Down
22 changes: 12 additions & 10 deletions layers/+email/mu4e/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
(mu4e :location site)
mu4e-alert
mu4e-maildirs-extension
helm-mu
(helm-mu :requires helm)
org
persp-mode
))
Expand All @@ -41,7 +41,7 @@
:commands (mu4e mu4e-compose-new)
:init
(progn
(spacemacs/set-leader-keys "a m m" 'mu4e)
(spacemacs/set-leader-keys "a M" 'mu4e)
(global-set-key (kbd "C-x m") 'mu4e-compose-new))
:config
(progn
Expand Down Expand Up @@ -93,14 +93,16 @@
(mu4e-alert-enable-mode-line-display)))))

(defun mu4e/init-helm-mu ()
(spacemacs/set-leader-keys
"a m s" 'helm-mu
"a m c" 'helm-mu-contacts))

(defun mu4e/post-init-helm ()
(require 'helm-config)
(autoload 'helm-mu "helm-mu" "" t)
(autoload 'helm-mu-contacts "helm-mu" "" t))
(use-package helm-mu
:defer t
:init (dolist (m '(mu4e-main-mode-hook
mu4e-headers-mode-hook
mu4e-view-mode-hook
mu4e-compose-mode-hook))
(spacemacs/set-leader-keys-for-major-mode m
"S" 'helm-mu
"/" 'helm-mu
"C" 'helm-mu-contacts))))

(defun mu4e/init-mu4e-maildirs-extension ()
(use-package mu4e-maildirs-extension
Expand Down

0 comments on commit 0b484bc

Please sign in to comment.