Markdown layer
Table of ContentsClose
1 Description
This layer adds markdown support to Spacemacs.
1.1 Features
- markdown files support via markdown-mode
- Fast Github-flavored live preview via vmd-mode
- TOC generation via markdown-toc
- Completion of Emojis using company-emoji (still needs a way of showing, either
using the
emoji
layer or having a proper font) :clap:
1.2 BibTeX
For more extensive support of references with BibTeX files, have a look at the BibTeX layer.
2 Install
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.
3 Configuration
3.1 Live preview
By default the built-in Emacs web browser is used to live preview a markdown buffer.
To use vmd
(Github-flavored live preview) instead set the value of the
variable markdown-live-preview-engine
to vmd
:
dotspacemacs-configuration-layers '( (markdown :variables markdown-live-preview-engine 'vmd))
And install the executable with:
npm install -g vmd
5 Key bindings
5.1 Element insertion
Key Binding | Description |
---|---|
SPC m - |
insert horizontal line |
SPC m h i |
insert header dwim |
SPC m h I |
insert header setext dwim |
SPC m h 1 |
insert header atx 1 |
SPC m h 2 |
insert header atx 2 |
SPC m h 3 |
insert header atx 3 |
SPC m h 4 |
insert header atx 4 |
SPC m h 5 |
insert header atx 5 |
SPC m h 6 |
insert header atx 6 |
SPC m h ! |
insert header setext 1 |
SPC m h @ |
insert header setext 2 |
SPC m i l |
insert link |
SPC m i L |
insert reference link dwim |
SPC m i u |
insert uri |
SPC m i f |
insert footnote |
SPC m i w |
insert wiki link |
SPC m i i |
insert image |
SPC m i I |
insert reference image |
SPC m x b |
make region bold or insert bold |
SPC m x i |
make region italic or insert italic |
SPC m x c |
make region code or insert code |
SPC m x C |
make region code or insert code (Github Flavored Markdown format) |
SPC m x q |
make region blockquote or insert blockquote |
SPC m x Q |
blockquote region |
SPC m x p |
make region or insert pre |
SPC m x P |
pre region |
5.7 Buffer-wide commands
Key Binding | Description |
---|---|
SPC m c ] |
complete buffer |
SPC m c m |
other window |
SPC m c p |
preview |
SPC m c P |
live preview using engine defined with layer variable markdown-live-preview-engine |
SPC m c e |
export |
SPC m c v |
export and preview |
SPC m c o |
open |
SPC m c w |
kill ring save |
SPC m c c |
check refs |
SPC m c n |
cleanup list numbers |
SPC m c r |
render buffer |