markdown: refactor config

This commit is contained in:
Henrik Lissner 2016-04-19 03:13:48 -04:00
parent 2cbcf55a24
commit 1addb26840

View file

@ -7,36 +7,32 @@
markdown-wrap-or-insert markdown-wrap-or-insert
markdown-unwrap-thing-at-point) markdown-unwrap-thing-at-point)
:init :init
(add-hook 'markdown-mode-hook 'narf|enable-hard-wrap) (add-hook 'markdown-mode-hook 'turn-on-auto-fill)
:config :config
(sp-local-pair 'markdown-mode "```" "```" (map! :map markdown-mode-map
:post-handlers '(("||\n[i]" "RET")) "<backspace>" nil
:unless '(sp-point-before-word-p sp-point-before-same-p)) "<M-left>" nil
"<M-right>" nil
(map! (:map markdown-mode-map ;; Assumes you have a markdown renderer plugin in chrome
"<backspace>" nil :nv "M-r" (λ! (narf-open-with "Google Chrome"))
"<M-left>" nil
"<M-right>" nil
;; Assumes you have a markdown renderer plugin in chrome "M-*" 'markdown-insert-list-item
:nv "M-r" (λ! (narf-open-with "Google Chrome")) "M-b" 'markdown-insert-bold
"M-i" 'markdown-insert-italic
"M-`" 'narf/markdown-insert-del
"M-*" 'markdown-insert-list-item (:localleader
"M-b" 'markdown-insert-bold :nv "i" 'markdown-insert-image
"M-i" 'markdown-insert-italic :nv "l" 'markdown-insert-link
"M-`" 'narf/markdown-insert-del :nv "L" 'markdown-insert-reference-link-dwim
:nv "b" 'markdown-preview)
(:localleader ;; TODO: Make context sensitive
:nv "i" 'markdown-insert-image :n "[p" 'markdown-promote
:nv "l" 'markdown-insert-link :n "]p" 'markdown-demote
:nv "L" 'markdown-insert-reference-link-dwim
:nv "b" 'markdown-preview)
;; TODO: Make context sensitive :i "M--" 'markdown-insert-hr)
:n "[p" 'markdown-promote
:n "]p" 'markdown-demote
:i "M--" 'markdown-insert-hr))
(use-package markdown-toc :commands (markdown-toc-generate-toc))) (use-package markdown-toc :commands (markdown-toc-generate-toc)))