Home

Awesome

Markdown Support for Visual Studio Code <!-- omit in toc -->

version installs GitHub Workflow Status GitHub stars GitHub Contributors

All you need for Markdown (keyboard shortcuts, table of contents, auto preview and more).

Note: VS Code has basic Markdown support out-of-the-box (e.g, Markdown preview), please see the official documentation for more information.

Table of Contents

Features

Keyboard shortcuts

<p><img src="https://github.com/yzhang-gh/vscode-markdown/raw/master/images/gifs/toggle-bold.gif" alt="toggle bold gif" width="282px"> <br>(Typo: multiple words)</p> <p><img src="https://github.com/yzhang-gh/vscode-markdown/raw/master/images/gifs/check-task-list.gif" alt="check task list" width="240px"></p>

See full key binding list in the keyboard shortcuts section

Table of contents

<p><img src="https://github.com/yzhang-gh/vscode-markdown/raw/master/images/toc.png" alt="toc" width="305px"></p>

List editing

<p><img src="https://github.com/yzhang-gh/vscode-markdown/raw/master/images/gifs/on-enter-key.gif" alt="on enter key" width="214px"></p> <p><img src="https://github.com/yzhang-gh/vscode-markdown/raw/master/images/gifs/tab-backspace.gif" alt="on tab/backspace key" width="214px"></p> <p><img src="https://github.com/yzhang-gh/vscode-markdown/raw/master/images/gifs/fix-marker.gif" alt="fix ordered list markers" width="214px"></p>

Note: By default, this extension tries to determine indentation size for different lists according to CommonMark Spec. If you prefer to use a fixed tab size, please change the list.indentationSize setting.

Print Markdown to HTML

GitHub Flavored Markdown

Math

<p><img src="https://github.com/yzhang-gh/vscode-markdown/raw/master/images/math.png" alt="math" width="544px"></p>

Please use Markdown+Math for dedicated math support. Be sure to disable math.enabled option of this extension.

Auto completions

Tip: also support the option completion.root

Others

Available Commands

Keyboard Shortcuts

<details> <summary>Table</summary>
KeyCommand
<kbd>Ctrl</kbd>/<kbd>Cmd</kbd> + <kbd>B</kbd>Toggle bold
<kbd>Ctrl</kbd>/<kbd>Cmd</kbd> + <kbd>I</kbd>Toggle italic
<kbd>Alt</kbd>+<kbd>S</kbd> (on Windows)Toggle strikethrough<sup>1</sup>
<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>]</kbd>Toggle heading (uplevel)
<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>[</kbd>Toggle heading (downlevel)
<kbd>Ctrl</kbd>/<kbd>Cmd</kbd> + <kbd>M</kbd>Toggle math environment
<kbd>Alt</kbd> + <kbd>C</kbd>Check/Uncheck task list item
<kbd>Ctrl</kbd>/<kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd>Toggle preview
<kbd>Ctrl</kbd>/<kbd>Cmd</kbd> + <kbd>K</kbd> <kbd>V</kbd>Toggle preview to side

<sup>1. If the cursor is on a list/task item without selection, strikethrough will be added to the whole item (line)</sup>

</details>

Supported Settings

<details> <summary>Table</summary>
NameDefaultDescription
markdown.extension.completion.respectVscodeSearchExcludetrueWhether to consider search.exclude option when providing file path completions
markdown.extension.completion.rootRoot folder when providing file path completions (It takes effect when the path starts with /)
markdown.extension.italic.indicator*Use * or _ to wrap italic text
markdown.extension.bold.indicator**Use ** or __ to wrap bold text
markdown.extension.katex.macros{}KaTeX macros e.g. { "\\name": "expansion", ... }
markdown.extension.list.indentationSizeadaptiveUse different indentation size for ordered and unordered list
markdown.extension.list.toggle.candidate-markers[ "-", "*", "+", "1.", "1)" ]Use a array for toggle ordered list marker e.g. ["*", "1."]
markdown.extension.orderedList.autoRenumbertrueAuto fix list markers as you edits
markdown.extension.orderedList.markerorderedOr one: always use 1. as ordered list marker
markdown.extension.preview.autoShowPreviewToSidefalseAutomatically show preview when opening a Markdown file.
markdown.extension.print.absoluteImgPathtrueConvert image path to absolute path
markdown.extension.print.imgToBase64falseConvert images to base64 when printing to HTML
markdown.extension.print.includeVscodeStylesheetstrueWhether to include VS Code's default styles
markdown.extension.print.onFileSavefalsePrint to HTML on file save
markdown.extension.print.themelightTheme of the exported HTML
markdown.extension.print.validateUrlstrueEnable/disable URL validation when printing
markdown.extension.syntax.decorationstrueAdd decorations to strikethrough and code span
markdown.extension.syntax.decorationFileSizeLimit50000Don't render syntax decorations if a file is larger than this size (in byte/B)
markdown.extension.syntax.plainThemefalseA distraction-free theme
markdown.extension.tableFormatter.enabledtrueEnable GFM table formatter
markdown.extension.toc.slugifyModegithubSlugify mode for TOC link generation (vscode, github, gitlab or gitea)
markdown.extension.toc.omittedFromToc{}Lists of headings to omit by project file (e.g. { "README.md": ["# Introduction"] })
markdown.extension.toc.levels1..6Control the heading levels to show in the table of contents.
markdown.extension.toc.orderedListfalseUse ordered list in the table of contents.
markdown.extension.toc.plaintextfalseJust plain text.
markdown.extension.toc.unorderedList.marker-Use -, * or + in the table of contents (for unordered list)
markdown.extension.toc.updateOnSavetrueAutomatically update the table of contents on save.
</details>

FAQ

Q: Error "command 'markdown.extension.onXXXKey' not found"

Q: Which Markdown syntax is supported?

For other Markdown syntax, you need to install the corresponding extensions from VS Code marketplace (e.g. Mermaid diagram, emoji, footnotes and superscript). Once installed, they will take effect in VS Code and also the exported HTML file.

Q: This extension has overridden some of my key bindings (e.g. <kbd>Ctrl</kbd> + <kbd>B</kbd>, <kbd>Alt</kbd> + <kbd>C</kbd>)

You can easily manage key bindings with VS Code's Keyboard Shortcuts editor. (Commands provided by this extension have prefix markdown.extension.)

Q: The extension is unresponsive, causing lag etc. (performance issues)

From experience, there is a good chance that the performance issues are caused by other extensions (e.g., some spell checker extensions).

This can be verified if you try again with all other extensions disabled (execute Developer: Reload with Extensions Disabled or Extensions: Disable All Installed Extensions for this Workspace in the VS Code command Palette) and then enable this extension.

To find out the root cause, you can install our development build (debug.vsix) and create a CPU profile following this official instruction from the VS Code. And then please open a GitHub issue with that profile (.cpuprofile.txt) attached.

Changelog

See CHANGELOG for more information.

Latest Development Build

Download it here, please click the latest passing event to download artifacts.

There are two versions: markdown-all-in-one-*.vsix is the regular build, while debug.vsix is used to create a verbose CPU profile.

To install, execute Extensions: Install from VSIX... in the VS Code Command Palette (ctrl + shift + p)

Contributing

Special thanks to the collaborator @Lemmingh and all other contributors.


Related

More extensions of mine