Skip to content
Free · No signup · Instant

VS Code Markdown Guide

Write and preview markdown in VS Code. Built-in preview, top extensions, keyboard shortcuts, and advanced tips.

Built-in previewExtension ecosystemGit integratedFree forever

Quick Reference

VS Code markdown shortcuts and syntax at a glance.

FeatureSyntax
Open previewCtrl+Shift+V / Cmd+Shift+V
Preview side by sideCtrl+K V / Cmd+K V
Heading H1# Heading
Bold**bold**
Italic*italic*
Code inline`code`
Code block```lang
Link[text](url)
Image![alt](path)
Table| Col | Col |
Task list- [ ] todo
Strikethrough~~text~~
Blockquote> quote
Horizontal rule---

Built-in Preview

VS Code ships with a full markdown preview engine. No extensions needed for basic rendering.

Opening the Preview

Two ways to open the markdown preview

README.md
Ctrl+Shift+V
Full preview tab
Ctrl+K V
Side-by-side preview

What the Preview Supports

VS Code's built-in preview renders full GFM including math

README.md
  • ✅ Standard markdown (headings, bold, italic, lists)
  • ✅ GitHub Flavored Markdown (GFM)
  • ✅ Syntax highlighting in code blocks
  • ✅ Tables and task lists
  • ✅ LaTeX math (KaTeX, since VS Code 1.58)
  • ✅ Emoji shortcodes
  • ✅ Mermaid diagrams (with extension)
  • ❌ HTML iframes (sandboxed)

Scroll Sync

Editor and preview scroll positions stay in sync automatically

README.md
Scroll sync is on by default

The editor and preview scroll together. Toggle with the sync icon in the preview toolbar, or disable in settings.

Must-Have Extensions

These four extensions transform VS Code into a professional markdown editing environment.

Markdown All in One

The essential extension — shortcuts, TOC, table formatter, and more

README.md
Markdown All in One by Yu Zhang
  • Ctrl+B / Ctrl+I — bold / italic
  • Ctrl+K — insert link
  • Alt+Shift+F — format table
  • Table of contents generation
  • Auto-continue lists on Enter

Prettier — Code Formatter

Auto-formats markdown files on save — tables, line wrapping, headings

README.md
Prettier by Prettier
{\n "proseWrap": "always",\n "printWidth": 80\n}

Formats tables, wraps long lines, and normalizes headings on save

Markdown Preview Enhanced

Advanced preview with mermaid, math, custom themes, and export to PDF/HTML

README.md
Markdown Preview Enhanced
  • Mermaid, PlantUML, Chart.js diagrams
  • KaTeX + MathJax math rendering
  • Export to PDF, HTML, PNG directly
  • Custom CSS themes for preview
  • Presentation / slideshow mode

markdownlint

Linting for consistent markdown style — catches common mistakes

README.md
markdownlint by David Anson
  • Missing blank lines around headings
  • Inconsistent heading level jumps
  • Trailing spaces and hard tabs
  • Bare URLs not wrapped in links
  • Configurable via .markdownlint.json

Keyboard Shortcuts

Built-in VS Code shortcuts plus Markdown All in One additions for faster editing.

Preview Shortcuts

Open and manage the markdown preview pane

README.md
Ctrl+Shift+VOpen preview in new tab
Ctrl+K VSide-by-side preview

Formatting Shortcuts (Markdown All in One)

Keyboard shortcuts added by the Markdown All in One extension

README.md
Ctrl+BToggle bold
Ctrl+IToggle italic
Ctrl+KInsert link on selected text
Alt+CToggle task list checkbox
Alt+Shift+FFormat table

Navigation Shortcuts

Navigate within and between markdown files

README.md
Ctrl+Shift+OGo to heading (outline)
Alt+ZToggle word wrap
Ctrl+Shift+PCommand palette → "Markdown: Create TOC"

Editing Shortcuts

General VS Code editing shortcuts that work great with markdown

README.md
Ctrl+Shift+P → FormatAuto-format entire file
Alt+↑ / Alt+↓Move line up or down
Shift+Alt+↓Duplicate current line

Custom Keybindings

Add your own shortcuts in keybindings.json for markdown actions

README.md
// keybindings.json — Ctrl+Shift+P → "Open Keyboard Shortcuts (JSON)"\n[\n {\n "key": "ctrl+shift+m",\n "command": "markdown.showPreviewToSide"\n }\n]

Snippets & Tasks

VS Code snippets let you insert boilerplate markdown instantly. Tasks automate Pandoc exports.

Markdown Snippets

Define reusable markdown templates in .vscode/markdown.code-snippets

README.md
// Type "front" + Tab to insert:\n---\ntitle: |cursor|\ndate: 2026-05-10\ntags: []\n---

Pandoc Export Task

Automate Pandoc conversions with a VS Code task in tasks.json

README.md
Pandoc Export Task
  • Create .vscode/tasks.json in your project
  • Press Ctrl+Shift+B to run the build task
  • Exports current file to PDF using Pandoc

Git Integration

Markdown files work seamlessly with VS Code's built-in Git support — diffs, history, and source control.

Markdown Diffs in Source Control

VS Code renders word-level diffs for markdown files in the SCM panel

README.md
Markdown Diffs
+ Added line in green\n- Removed line in red\n Unchanged line

Enable "Diff editor: Word wrap" in settings for long markdown lines

Timeline and File History

View the full git history of any markdown file via the Timeline view

README.md
Timeline View
  • Access via Explorer panel → Timeline section
  • Shows all git commits that touched the file
  • Click any commit to open a diff view
  • Works for any file tracked by git

Limitations in VS Code Markdown

Features that require extensions or workarounds.

Live collaboration editing

Use Live Share extension for real-time co-editing of markdown files

Native WYSIWYG editing

VS Code is code-first — use preview panel or extensions like Foam for wiki-style editing

Pro Tips

1Install "Markdown All in One"

This single extension adds keyboard shortcuts for bold, italic, and links; auto-formatting for lists and tables; a table of contents generator; and paste-as-markdown support. It's the most essential markdown extension for VS Code.

2Format document on save

With Prettier installed and set as the default formatter, enable "Format On Save" in VS Code settings (Ctrl+, → search "Format On Save"). Every time you save a .md file, Prettier cleans up tables, wraps lines, and normalizes headings.

3Enable word wrap for long lines

Press Alt+Z to toggle word wrap on and off. For markdown files, word wrap is almost always preferable to horizontal scrolling. You can also set "editor.wordWrap": "on" in settings.json for all files.

4Use outline view to navigate headings

Press Ctrl+Shift+O (Cmd+Shift+O on Mac) to open the outline view. VS Code builds a tree of all headings in your markdown file, making long documents easy to navigate.

Frequently asked questions

Everything you need to know.

1

Does VS Code have built-in markdown support?

Yes. VS Code has built-in markdown editing and preview support. Open any .md file and press Ctrl+Shift+V (Windows/Linux) or Cmd+Shift+V (Mac) to see the rendered preview. Press Ctrl+K V (Cmd+K V) to open the preview side by side with the editor. The built-in preview supports GFM, syntax highlighting, and math (with the built-in math renderer).

Export your markdown from VS Code?

Paste your VS Code markdown into our converter and download a polished PDF in one click.