Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Markdown ToggleNew to Visual Studio Code? Get it now.
Markdown Toggle

Markdown Toggle

Sahan Ranasingha

|
2 installs
| (0) | Free
Toggle Markdown files between source and preview in VS Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Markdown Toggle banner

Markdown Toggle

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

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft