doomemacs/modules/module-text.el

45 lines
1.4 KiB
EmacsLisp
Raw Normal View History

;;; module-text.el
2015-06-15 09:06:10 +02:00
(use-package markdown-mode
2016-04-05 23:58:32 -04:00
:mode ("\\.md$" "/README$")
2015-06-15 09:06:10 +02:00
:functions (markdown-use-region-p
markdown-unwrap-things-in-region
markdown-wrap-or-insert
markdown-unwrap-thing-at-point)
2015-09-30 13:47:57 -04:00
:init
2016-04-05 23:58:32 -04:00
(add-hook 'markdown-mode-hook 'narf|enable-hard-wrap)
2015-06-15 09:06:10 +02:00
:config
2016-03-28 21:39:13 -04:00
(sp-local-pair 'markdown-mode "```" "```"
:post-handlers '(("||\n[i]" "RET"))
:unless '(sp-point-before-word-p sp-point-before-same-p))
(map! (:map markdown-mode-map
"<backspace>" nil
"<M-left>" nil
"<M-right>" nil
;; Assumes you have a markdown renderer plugin in chrome
2015-12-11 22:43:31 -05:00
:nv "M-r" (λ! (narf-open-with "Google Chrome"))
"M-*" 'markdown-insert-list-item
"M-b" 'markdown-insert-bold
"M-i" 'markdown-insert-italic
"M-`" 'narf/markdown-insert-del
(:localleader
:nv "i" 'markdown-insert-image
:nv "l" 'markdown-insert-link
:nv "L" 'markdown-insert-reference-link-dwim
:nv "b" 'markdown-preview)
;; TODO: Make context sensitive
:n "[p" 'markdown-promote
:n "]p" 'markdown-demote
2016-04-16 21:25:18 -04:00
:i "M--" 'markdown-insert-hr))
(use-package markdown-toc :commands (markdown-toc-generate-toc)))
2015-06-15 09:06:10 +02:00
(provide 'module-text)
;;; module-text.el ends here