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:
- Open Extensions.
- Open the
... menu.
- Select
Install from VSIX....
- 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.