Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Markdown Preview by DefaultNew to Visual Studio Code? Get it now.
Markdown Preview by Default

Markdown Preview by Default

LeePB

|
1 install
| (0) | Free
When Markdown Preview is the default, VS Code may still open files from File Explorer as source. This extension restores the expected preview. / 当用户尝试从资源管理器以默认预览方式打开 Markdown 文件时,VS Code 可能仍显示源码;本扩展会将其修正为内置预览。
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Markdown Preview by Default

中文说明见下方: 跳转到中文说明

The problem

VS Code can occasionally ignore the default Markdown Preview setting and open .md files in the source editor, especially during a cold start or when a file is opened from File Explorer.

Without this extension, an ignored default setting leaves the file open as Markdown source. With this extension installed, the file is corrected and opened in VS Code's built-in Markdown Preview.

How to use

Install the extension and set Markdown Preview as the default editor for *.md files. The extension then works automatically whenever VS Code fails to apply that default.

How to stop

Disable or uninstall the extension from VS Code's Extensions view. To open Markdown as source by default, set Text Editor as the default editor for *.md files.

Behavior

The extension uses VS Code's built-in preview, checks whether a Markdown file opened in the requested view, and corrects it when necessary. Each file is corrected only once per VS Code session, so a later manual switch to the source editor is respected. It does not provide a separate Markdown renderer or run a background program.

License

MIT License. The complete terms are included in the LICENSE file.


Markdown 默认预览

解决的问题

VS Code 有时会忽略 Markdown Preview 的默认编辑器设置,导致 .md 文件仍以源码模式打开。这种情况尤其容易出现在冷启动或从 Windows 文件资源管理器打开文件时。

未安装本扩展时,如果 VS Code 忽略了默认设置,文件会停留在 Markdown 源码模式。安装本扩展后,文件会得到修正,并以 VS Code 内置的 Markdown 预览打开。

如何使用

安装本扩展,然后将 **Markdown Preview(Markdown 预览)**设置为 *.md 文件的默认编辑器。此后,当 VS Code 未能正确应用该默认设置时,扩展会自动生效。

如何停用

在 VS Code 扩展页面中禁用或卸载本扩展即可。如需让 Markdown 默认以源码方式打开,请将 **Text Editor(文本编辑器)**设为 *.md 文件的默认编辑器。

工作逻辑

本扩展使用 VS Code 自带的 Markdown 预览,确认 Markdown 文件是否按指定方式打开,并在必要时进行修正。每个文件在一次 VS Code 会话中只会自动修正一次;之后用户手动切换到源码模式时,扩展会尊重该操作,不再强制切回预览。它不会提供另一套 Markdown 渲染器,也不会运行后台程序。

许可证

本扩展采用 MIT 许可证,完整条款包含在 LICENSE 文件中。

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft