Skip to content

Latest commit

 

History

History
179 lines (146 loc) · 7.56 KB

README.org

File metadata and controls

179 lines (146 loc) · 7.56 KB

Markdown layer

img/markdown.png

Table of Contents

Description

This layer adds markdown support to Spacemacs.

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) 👏

BibTeX

For more extensive support of references with BibTeX files, have a look at the BibTeX layer.

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.

Configuration

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

Additionally there is flymd package in chrome layer that allows to preview markdown buffer in Chrome. Please refer to chrome layer documentation for more information.

Usage

Generate a TOC

To generate a table of contents type on top of the buffer: SPC SPC markdown-toc-generate-toc RET

Key bindings

Element insertion

Key BindingDescription
SPC m -insert horizontal line
SPC m h iinsert header dwim
SPC m h Iinsert header setext dwim
SPC m h 1insert header atx 1
SPC m h 2insert header atx 2
SPC m h 3insert header atx 3
SPC m h 4insert header atx 4
SPC m h 5insert header atx 5
SPC m h 6insert header atx 6
SPC m h !insert header setext 1
SPC m h @insert header setext 2
SPC m i linsert link
SPC m i Linsert reference link dwim
SPC m i uinsert uri
SPC m i finsert footnote
SPC m i winsert wiki link
SPC m i iinsert image
SPC m i Iinsert reference image
SPC m i tinsert Table of Contents (toc)
SPC m x bmake region bold or insert bold
SPC m x imake region italic or insert italic
SPC m x cmake region code or insert code
SPC m x Cmake region code or insert code (Github Flavored Markdown format)
SPC m x qmake region blockquote or insert blockquote
SPC m x Qblockquote region
SPC m x pmake region or insert pre
SPC m x Ppre region

Element removal

Key BindingDescription
SPC m kkill thing at point

Completion

Key BindingDescription
SPC m ]complete

Following and Jumping

Key BindingDescription
SPC m ofollow thing at point
SPC m jjump

Indentation

Key BindingDescription
SPC m \>indent region
SPC m \<exdent region

Header navigation

Key BindingDescription
gjoutline forward same level
gkoutline backward same level
ghoutline up one level
gloutline next visible heading

Buffer-wide commands

Key BindingDescription
SPC m c ]complete buffer
SPC m c mother window
SPC m c ppreview
SPC m c Plive preview using engine defined with layer variable markdown-live-preview-engine
SPC m c eexport
SPC m c vexport and preview
SPC m c oopen
SPC m c wkill ring save
SPC m c ccheck refs
SPC m c ncleanup list numbers
SPC m c rrender buffer

List editing

Key BindingDescription
SPC m l iinsert list item

Movement

Key BindingDescription
SPC m {backward paragraph
SPC m }forward paragraph
SPC m Nnext link
SPC m Pprevious link

Promotion, Demotion

Key BindingDescription
M-kmarkdown-move-up
M-jmarkdown-move-down
M-hmarkdown-promote
M-lmarkdown-demote