VS Code Extensions
Markdown Toggle

Markdown Toggle

by SahanRanasingha

Quickly toggle between Markdown source and preview in VS Code using the editor title bar, status bar, keyboard shortcut, or optional automatic preview when .md files open.

Downloads

80

Rating

— (0)

Version

1.0.0

Last updated

Apr 09, 2026

Markdown Toggle banner

Quickly switch between Markdown source and preview without leaving your flow.

Markdown Toggle adds a focused toggle experience for .md files in Visual Studio Code using built-in Markdown commands.

Why Markdown Toggle

When writing Markdown, you often jump between editing and reading. Markdown Toggle keeps that interaction fast and predictable:

  • One click in the editor title bar to open preview to the side.
  • One click again to return focus to the source editor.
  • Optional status bar access and keyboard shortcut.
  • Optional auto-preview when Markdown files become active.

Features

  • Markdown-only activation (onLanguage:markdown) for minimal overhead.
  • Editor title action (top right) shown only for Markdown files.
  • Status bar action shown only when a Markdown editor is active.
  • Internal preview state tracking to keep toggle behavior consistent.
  • Built on VS Code native commands:
    • markdown.showPreviewToSide
    • workbench.action.focusActiveEditorGroup

Commands

  • Markdown Toggle: Toggle Markdown Preview
    • Command ID: markdownToggle.togglePreview
  • Markdown Toggle: Toggle Auto Preview On Open
    • Command ID: markdownToggle.toggleAutoPreviewSetting
  • Markdown Toggle: Set Auto Preview On Open...
    • Command ID: markdownToggle.setAutoPreviewOnOpen
  • Markdown Toggle: Open Markdown Toggle Settings
    • Command ID: markdownToggle.openSettings

Keyboard Shortcut

  • Windows/Linux: Ctrl+Alt+M
  • macOS: Cmd+Alt+M

The shortcut is active only when a Markdown text editor is focused.

Configuration

  • markdownToggle.autoPreviewOnOpen (default: false)
    • Automatically opens Markdown preview when a Markdown file becomes active.

Usage

  1. Open any .md file.
  2. Click the title bar toggle, or run Markdown Toggle: Toggle Markdown Preview.
  3. Preview opens to the side.
  4. Trigger the toggle again to return focus to your source editor.

License

MIT