Table of Contents

Mermaid layer

Table of ContentsClose

logo.svg

1. Description

This layer adds support for Mermaid diagrams to Spacemacs. Mermaid is a JavaScript-based diagramming and charting tool that renders Markdown-inspired text definitions to create and display diagrams.

For help with how to use Mermaid, see the reference guide.

The official file extension supported by this layer is .mmd. If you want something else, set it in your user-config function of your ~/.spacemacs file.

For example, the following diagram can be defined as follows:

sequenceDiagram
    Server<<->>Client: Hello

1.1. Features:

  • Syntax highlighting for Mermaid files (with .mmd extension)
  • Diagram preview on region/buffer/file
  • Key bindings for compiling and changing output types

2. Installation

Add the layer to your ~/.spacemacs file:

(setq-default dotspacemacs-configuration-layers '(mermaid))

To compile mermaid diagram, please install mmdc command-line tool.

3. Key bindings

Key binding Description
SPC m c c Compile Mermaid diagram
SPC m c f Compile Mermaid file
SPC m c b Compile Mermaid buffer
SPC m c r Compile Mermaid region
SPC m c o Open browser with diagram
SPC m c d Open Mermaid documentation

Author: root

Created: 2026-02-20 Fri 23:44

Validate