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.showPreviewToSideworkbench.action.focusActiveEditorGroup
Commands
Markdown Toggle: Toggle Markdown Preview- Command ID:
markdownToggle.togglePreview
- Command ID:
Markdown Toggle: Toggle Auto Preview On Open- Command ID:
markdownToggle.toggleAutoPreviewSetting
- Command ID:
Markdown Toggle: Set Auto Preview On Open...- Command ID:
markdownToggle.setAutoPreviewOnOpen
- Command ID:
Markdown Toggle: Open Markdown Toggle Settings- Command ID:
markdownToggle.openSettings
- Command ID:
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
- Open any
.mdfile. - Click the title bar toggle, or run
Markdown Toggle: Toggle Markdown Preview. - Preview opens to the side.
- Trigger the toggle again to return focus to your source editor.
License
MIT