Skip to content

Commit

Permalink
chrome: define markdown key bindings for gmail-message-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed May 8, 2017
1 parent 280047b commit 17ac768
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions layers/+lang/markdown/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@
)
"List of language names or lists of language and mode names for which to
generate mmm classes.")

(defvar markdown--key-bindings-modes '(markdown-mode gfm-mode)
"Modes using markdown key bindings.")
2 changes: 1 addition & 1 deletion layers/+lang/markdown/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
'markdown-mode (car prefix) (cdr prefix)))
;; note: `gfm-mode' is part of `markdown-mode.el' so we can define its key
;; bindings here
(dolist (mode '(markdown-mode gfm-mode))
(dolist (mode markdown--key-bindings-modes)
(spacemacs/set-leader-keys-for-major-mode mode
;; Movement
"{" 'markdown-backward-paragraph
Expand Down
7 changes: 7 additions & 0 deletions layers/+tools/chrome/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
edit-server
gmail-message-mode
flymd
markdown-mode
))

(defun chrome/init-edit-server ()
Expand All @@ -33,3 +34,9 @@
:defer t
:init (setq flymd-browser-open-function
'spacemacs//flymd-browser-function)))

(defun chrome/pre-init-markdown-mode ()
(spacemacs|use-package-add-hook markdown-mode
:pre-config
(when (configuration-layer/package-usedp 'gmail-message-mode)
(add-to-list 'markdown--key-bindings-modes 'gmail-message-client-mode))))

0 comments on commit 17ac768

Please sign in to comment.