Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Same Tab Markdown Preview ToggleNew to Visual Studio Code? Get it now.
Same Tab Markdown Preview Toggle

Same Tab Markdown Preview Toggle

ZihuaLiu

|
2 installs
| (0) | Free
Adds editor title buttons to switch the current Markdown file between VS Code's built-in preview and source views.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Same Tab Markdown Preview Toggle

Adds two editor title actions for Markdown files:

  • Preview: reopens the current Markdown editor as VS Code's built-in Markdown Preview.
  • Markdown: reopens the built-in Markdown Preview as the source editor.
  • Markdown: Use Preview by Default: makes .md files open with VS Code's built-in Markdown Preview by default.
  • Markdown: Use Markdown Source by Default: restores the default source editor for .md files.

This extension does not render Markdown itself. It reopens the current file with VS Code's built-in vscode.markdown.preview.editor custom editor, so preview behavior, styles, link handling, and security behavior remain the same as the native Markdown extension.

On VS Code versions that expose reopenActiveEditorWith, the extension uses that command. On older VS Code versions such as 1.85.2, it falls back to the public vscode.openWith command and closes the previous non-dirty tab if VS Code opens a duplicate tab.

Default Open Mode

Set currentMarkdownPreviewToggle.defaultMarkdownOpenMode to preview to open .md files with the built-in preview by default. Internally this manages the global VS Code setting:

{
  "workbench.editorAssociations": {
    "*.md": "vscode.markdown.preview.editor"
  }
}

Set it back to source, or run Markdown: Use Markdown Source by Default, to restore the source editor default.

Install From VSIX

code --install-extension same-tab-markdown-preview-toggle-0.3.1.vsix

Or use VS Code:

  1. Open Extensions.
  2. Open the ... menu.
  3. Select Install from VSIX....
  4. Choose same-tab-markdown-preview-toggle-0.3.1.vsix.

Build

npm install
npm run compile
npm run package

Requirement

VS Code 1.85.0 or newer is required.

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