Add vmd support in markdown mode

This commit is contained in:
Jeremy Bi 2016-06-01 13:53:06 +08:00 committed by syl20bnr
parent 14c4b7e6c4
commit c267c36be1
2 changed files with 16 additions and 0 deletions

View File

@ -25,6 +25,7 @@ This layer adds markdown support to Spacemacs.
** Features:
- markdown files support via [[http://jblevins.org/git/markdown-mode.git/][markdown-mode]]
- Fast Github-flavored live preview via [[https://github.com/blak3mill3r/vmd-mode][vmd-mode]]
- TOC generation via [[https://github.com/ardumont/markdown-toc][markdown-toc]]
- Completion of Emojis using [[https://github.com/dunn/company-emoji][company-emoji]] (still needs a way of showing, either
using the =emoji= layer or having a proper font) :clap:
@ -38,6 +39,9 @@ To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =markdown= to the existing =dotspacemacs-configuration-layers= list in this
file.
To enable Github-flavored live preview, you will need to install the executable
with =npm install -g vmd=.
* Usage
To generate a table of contents type on top of the buffer:
~SPC SPC markdown-toc/generate-toc RET~
@ -117,6 +121,7 @@ To generate a table of contents type on top of the buffer:
| ~SPC m c m~ | other window |
| ~SPC m c p~ | preview |
| ~SPC m c P~ | live preview in Emacs' built-in browser |
| ~SPC m c d~ | Github-flavored live preview |
| ~SPC m c e~ | export |
| ~SPC m c v~ | export and preview |
| ~SPC m c o~ | open |

View File

@ -19,6 +19,7 @@
markdown-toc
mmm-mode
smartparens
vmd-mode
))
(defun markdown/post-init-company ()
@ -216,3 +217,13 @@ Will work on both org-mode and any mode that accepts plain html."
(mmm-add-mode-ext-class 'markdown-mode nil 'markdown-javascript)
(mmm-add-mode-ext-class 'markdown-mode nil 'markdown-ess)
(mmm-add-mode-ext-class 'markdown-mode nil 'markdown-rust))))
(defun markdown/init-vmd-mode ()
(use-package vmd-mode
:if (executable-find "vmd")
:defer t
:init
(progn
(spacemacs/set-leader-keys-for-major-mode 'markdown-mode
;; Github-flavored live preview in a separate window
"cd" 'vmd-mode))))