Skip to content

Latest commit

 

History

History
231 lines (188 loc) · 9.46 KB

README.org

File metadata and controls

231 lines (188 loc) · 9.46 KB

Markdown layer

img/markdown.png

Table of Contents

Description

This layer adds markdown support to Spacemacs.

Features:

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

A live preview can be generated when one of these executables are in path:

  • markdown
  • pandoc
  • markdown_py

A well-knowned markdown command is from https://daringfireball.net/projects/markdown/. Or follow pandoc installation instructions to install pandoc into path: https://pandoc.org/installing.html

Another choice is installing Python-Markdown:

pip install --user Markdown

If your markdown executable is not in the list, please refer the document of markdown-mode for customizing the markdown-command.

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 uinsert uri
SPC m i finsert footnote
SPC m i winsert wiki link
SPC m i iinsert image
SPC m i tinsert Table of Contents (toc)
SPC m i Tinsert general markdown table
SPC m x bmake region bold or insert bold
SPC m x Binsert gfm checkbox
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 kmake region <kbd> element or insert <kbd> element
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
SPC m x smake region striked through or insert strikethrough

Element removal

Key bindingDescription
SPC m kkill thing at point

Table manipulation

Key bindingDescription
SPC m t aalign table
SPC m t pmove row up
SPC m t nmove row down
SPC m t fmove column right
SPC m t bmove column left
SPC m t rinsert row
SPC m t Rdelete row
SPC m t cinsert column
SPC m t Cdelete column
SPC m t ssort lines
SPC m t ttranspose table
SPC m t dconvert region to table

Completion

Key bindingDescription
SPC m ]complete

Following and Jumping

Key bindingDescription
SPC m ofollow thing at point
RETjump (markdown-do)

Indentation

Key bindingDescription
SPC m >indent region
SPC m <outdent 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 bindingCommand
M-k or M-upmarkdown-move-up
M-j or M-downmarkdown-move-down
M-h or M-leftmarkdown-promote
M-l or M-rightmarkdown-demote

Toggles

Key bindingDescription
SPC m T itoggle inline images
SPC m T ltoggle hidden urls
SPC m T mtoggle markup hiding
SPC m T ttoggle checkbox
SPC m T wtoggle wiki links