Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>MD ViewNew to Visual Studio Code? Get it now.
MD View

MD View

sikilab

|
8,394 installs
| (0) | Free
Markdown 预览插件,支持目录导航、Mermaid 和图片管理 / Markdown preview with TOC navigation, Mermaid, and image management
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

MD View - Markdown 预览插件

中文

MD View 是一款适用于 VS Code 和 Cursor 的 Markdown 预览插件,支持目录导航、双向滚动同步、Mermaid 图表和本地图片管理。

预览效果

MD View 预览

✨ 功能特性

Markdown 预览与目录导航

  • 渲染 Markdown 内容,并在左侧自动生成文档目录(TOC)。
  • 点击目录项可以快速定位到对应标题。
  • 编辑文档时实时刷新预览。
  • 编辑区与预览区支持双向滚动同步。
  • 滚动同步会以当前鼠标或焦点所在侧为基准;编辑输入时,预览刷新不会反向拖动编辑区。

Mermaid 图表预览

  • 自动渲染 mermaid 代码块,并使用 ELK 布局优化复杂图表。
  • 支持“图表 / 源码”切换。
  • 支持弹窗放大、滚轮缩放、拖动画布和重置视图。
  • 图表和源码区域跟随 VS Code / Cursor 的明暗主题。
  • Mermaid 语法错误时显示错误信息和原始源码。

图片粘贴与本机插入

  • 粘贴图片:将剪贴板图片保存到文档同级的 images/ 目录并插入 Markdown 引用。
  • 插入图片:通过命令面板或预览工具栏选择本机图片,支持一次多选并按顺序插入。
  • 已位于当前文档 images/ 目录下的图片只插入引用,不重复复制。
  • 预览面板支持显示工作区内不同目录中的本地图片,并可点击查看大图。

🚀 使用方法

打开预览

  • 快捷键:Windows/Linux 为 Ctrl+Shift+M,macOS 为 Cmd+Shift+M。
  • 命令面板:执行“MD View: 打开预览”。
  • 编辑器标题栏:点击 MD View 预览图标。

粘贴剪贴板图片

  1. 将截图或图片复制到剪贴板。
  2. 将光标放到 Markdown 编辑器中的目标位置。
  3. 使用 Windows/Linux 快捷键 Ctrl+Shift+Alt+V、macOS 快捷键 Cmd+Shift+Alt+V,或点击预览工具栏中的“粘贴图片”。
  4. 图片会保存为 images/image-<时间戳>.png,并自动插入 Markdown 引用。

插入本机图片

  1. 将 Markdown 文件保存到本地,并把光标放到目标位置。
  2. 执行“MD View: 插入图片”,或点击预览工具栏中的“插入图片”。
  3. 在文件选择器中选择一张或多张图片;插件会按选择顺序逐行插入。

📁 图片目录结构

your-document.md
images/
  ├── image-2026-01-26T10-30-00-000Z.png
  ├── image-2026-01-26T10-35-00-000Z.png
  └── ...

🔧 开发

npm install
npm run compile
npm run watch

在 VS Code 中按 F5,即可启动扩展开发宿主进行调试。

其他项目

  • DemoView:一个用于 Markdown 文档预览、传播和业务演示的工具,支持 CLI 工作流。需要了解或试用可以联系 mdview@sikilab.net。

English

MD View is a Markdown preview extension for VS Code and Cursor with table-of-contents navigation, synchronized scrolling, Mermaid diagrams, and local image management.

Preview

MD View preview

✨ Features

Markdown Preview and TOC Navigation

  • Renders Markdown content and automatically generates a table of contents on the left.
  • Jumps to a heading when you select an item in the table of contents.
  • Refreshes the preview while you edit the document.
  • Synchronizes scrolling in both directions between the editor and preview.
  • Uses the side under the pointer or focus as the scroll source, so preview refreshes will not drag the editor while you type.

Mermaid Diagram Preview

  • Renders mermaid code blocks automatically and uses ELK layout for complex diagrams.
  • Switches between diagram and source views.
  • Provides a large viewer with wheel zoom, drag-to-pan, and reset controls.
  • Follows the current VS Code or Cursor light/dark theme for diagrams and source code.
  • Shows the error and original source when Mermaid syntax is invalid.

Paste and Insert Images

  • Paste images: saves clipboard images to the document's sibling images/ directory and inserts Markdown references.
  • Insert images: selects local image files from the Command Palette or preview toolbar, with multi-select support.
  • References images already located under the current document's images/ directory without copying them again.
  • Displays local images from different workspace directories and supports click-to-enlarge preview.

🚀 Usage

Open Preview

  • Shortcut: Ctrl+Shift+M on Windows/Linux or Cmd+Shift+M on macOS.
  • Command Palette: run “MD View: Open Preview” / “MD View: 打开预览”.
  • Editor title bar: click the MD View preview icon.

Paste a Clipboard Image

  1. Copy a screenshot or image to the clipboard.
  2. Place the cursor at the target position in the Markdown editor.
  3. Press Ctrl+Shift+Alt+V on Windows/Linux or Cmd+Shift+Alt+V on macOS, or click “Paste Image” in the preview toolbar.
  4. The image is saved as images/image-<timestamp>.png, and its Markdown reference is inserted automatically.

Insert Local Images

  1. Save the Markdown file locally and place the cursor at the target position.
  2. Run “MD View: Insert Image” / “MD View: 插入图片”, or click the insert-image button in the preview toolbar.
  3. Select one or more images. They are inserted one per line in selection order.

📁 Image Directory Structure

your-document.md
images/
  ├── image-2026-01-26T10-30-00-000Z.png
  ├── image-2026-01-26T10-35-00-000Z.png
  └── ...

🔧 Development

npm install
npm run compile
npm run watch

Press F5 in VS Code to launch an Extension Development Host for testing.

Related Projects

  • DemoView: A tool for Markdown document preview, sharing, and business demos, with CLI workflow support. To learn more or request access, contact mdview@sikilab.net.

License

MIT

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