Add lang/text

This commit is contained in:
Henrik Lissner
2017-02-11 07:07:26 -05:00
parent 2df2c9298f
commit 6f67dff8f2
3 changed files with 45 additions and 19 deletions

View File

@@ -1,15 +1,9 @@
;;; module-text.el
;;; lang/text/config.el
(associate! text-mode :match "/LICENSE$")
(use-package markdown-mode
(@def-package markdown-mode
:mode ("\\.m\\(d\\|arkdown\\)$" "/README$"
("/README\\.md$" . gfm-mode))
:init
(add-hook! markdown-mode
(auto-fill-mode +1)
(setq line-spacing 2
fill-column 70))
(setq markdown-enable-wiki-links t
markdown-enable-math t
markdown-italic-underscore t
@@ -17,23 +11,27 @@
markdown-gfm-additional-languages '("sh"))
:config
(def-electric! markdown-mode :chars ("+" "#"))
(@add-hook markdown-mode
(auto-fill-mode +1)
(setq line-spacing 2
fill-column 70))
(sp-local-pair
'(markdown-mode gfm-mode)
"\`\`\`" "\`\`\`" :post-handlers '(("||\n" "RET")))
(map! :map gfm-mode-map "`" 'self-insert-command)
(map! :map markdown-mode-map
(@set :electric-chars "+" "#")
(@map :map gfm-mode-map "`" 'self-insert-command)
(@map :map markdown-mode-map
"<backspace>" nil
"<M-left>" nil
"<M-right>" nil
"M-*" 'markdown-insert-list-item
"M-b" 'markdown-insert-bold
"M-i" 'markdown-insert-italic
"M-`" 'doom/markdown-insert-del
"M-`" '+text/markdown-insert-del
;; Assumes you have a markdown renderer plugin in chrome
:nv "M-r" (λ! (doom-open-with "Google Chrome"))
:nv "M-r" (@λ (doom-open-with "Google Chrome"))
;; TODO: Make context sensitive
:n "[p" 'markdown-promote
:n "]p" 'markdown-demote
@@ -44,11 +42,11 @@
:nv "L" 'markdown-insert-reference-link-dwim
:nv "b" 'markdown-preview)))
(use-package markdown-toc :after markdown-mode)
(use-package rst
(@def-package markdown-toc
:after markdown-mode)
(@def-package rst ; built-in
:mode ("\\.re?st$" . rst-mode)
:config (def-builder! rst-mode rst-compile-pdf-preview))
(provide 'module-text)
;;; module-text.el ends here
:config (@set :builder '(rst-mode rst-compile-pdf-preview)))