Package Control

The official Sublime Text package manager.

MarkdownPreviewEnhanced

Live Markdown preview in the browser for Sublime Text 4 — SSE updates, KaTeX, Mermaid, ECharts, and presentation mode.

By CaffeineOddity
Created July 8, 2026, last updated September 18, 2026.

AugJulJunMayAprMarFebJan Dec2025 NovOctSep 2026-W38 | installs: 325 | removals: 63 | upgrades: 456 2026-W38 | installs: 325 | removals: 63 | upgrades: 456 2026-W38 | installs: 325 | removals: 63 | upgrades: 456 2026-W37 | installs: 439 | removals: 85 | upgrades: 1,281 2026-W37 | installs: 439 | removals: 85 | upgrades: 1,281 2026-W37 | installs: 439 | removals: 85 | upgrades: 1,281 2026-W36 | installs: 365 | removals: 84 | upgrades: 1,005 2026-W36 | installs: 365 | removals: 84 | upgrades: 1,005 2026-W36 | installs: 365 | removals: 84 | upgrades: 1,005 2026-W35 | installs: 327 | removals: 62 | upgrades: 645 2026-W35 | installs: 327 | removals: 62 | upgrades: 645 2026-W35 | installs: 327 | removals: 62 | upgrades: 645 2026-W34 | installs: 244 | removals: 36 | upgrades: 396 2026-W34 | installs: 244 | removals: 36 | upgrades: 396 2026-W34 | installs: 244 | removals: 36 | upgrades: 396 2026-W33 | installs: 267 | removals: 49 | upgrades: 137 2026-W33 | installs: 267 | removals: 49 | upgrades: 137 2026-W33 | installs: 267 | removals: 49 | upgrades: 137 2026-W32 | installs: 269 | removals: 95 | upgrades: 64 2026-W32 | installs: 269 | removals: 95 | upgrades: 64 2026-W32 | installs: 269 | removals: 95 | upgrades: 64 2026-W31 | installs: 203 | removals: 71 | upgrades: 0 2026-W31 | installs: 203 | removals: 71 | upgrades: 0 2026-W31 | installs: 203 | removals: 71 | upgrades: 0 0200400 WeeklyInstalls 01K2K WeeklyUpgrades 2026-W38 | upgrades: 456 0.2.4 2026-W37 | upgrades: 1,281 0.2.3 / 0.2.2 2026-W36 | upgrades: 1,005 0.2.1 / 0.2.0 / ... 0.2.1 / 0.2.0 / 0.1.9 / 0.1.8 2026-W35 | upgrades: 645 0.1.7 / 0.1.6 2026-W34 | upgrades: 396 0.1.5 / 0.1.4 / ... 0.1.5 / 0.1.4 / 0.1.3 / 0.1.2 2026-W32 | upgrades: 64 0.1.1 2026-W31 | upgrades: 0 0.1.0
Installations: recent average 302 per week, 2,439 in total
Installations minus removals
Upgrades

Links

Versions

0.2.4 (>ST4106) ·
2026-09-18 06:12

More

MarkdownPreviewEnhanced

English | 中文

Browser live Markdown preview for Sublime Text 4. No extra installs.

preview

Features

Preview Markdown
✅ Live preview in the browser ✅ GitHub-style HTML / CSS
✅ SSE in-place update (no reload) ✅ Syntax highlighting
✅ One file ↔ one preview tab ✅ GFM task lists
✅ Editor ↔ preview tab switch ✅ Footnotes
✅ Scroll sync (editor ↔ preview) ✅ GFM emoji (:smile:)
✅ TOC + preview tab list ✅ YAML frontmatter
✅ Presentation mode (16:9 slides) ✅ KaTeX ($…$ / $$…$$)
✅ Dark mode (follows system, persisted) ✅ Mermaid diagrams (click to zoom)
✅ Copy as rich text (📋 / command) ✅ ECharts
✅ Paste as markdown (⇧⌘V / right-click) ✅ Callouts (> [!NOTE])
✅ Code block copy button ~~del~~ ==mark== ^sup^ ~sub~
✅ Relative images (./img/a.png) ✅ Task list checkbox sync (click in preview)
✅ Export HTML / PNG / PDF ✅ Image click zoom
✅ Custom CSS & favicon ✅ No extra installs
✅ macOS / Windows / Linux

Install

Command Palette → Package Control: Install PackageMarkdownPreviewEnhanced

Or clone this repo to Packages/MarkdownPreviewEnhanced/ (repo root = package root).

Usage

Open a .md file, then press Cmd+Shift+M (Windows / Linux: Ctrl+Shift+M) to open / focus the preview.

This is the only other default key binding (issue #6 - don't shadow common shortcuts). Close, Refresh, Presentation Mode, Export HTML and Export PDF are available from the Command Palette; add your own bindings in User/Default (OSX).sublime-keymap if wanted.

Paste as markdown

Copy content from a web page, then in a .md file press Cmd+Shift+V (Windows / Linux: Ctrl+Shift+V) or right-click -> Paste as Markdown. The clipboard HTML is converted to markdown (headings, bold/italic, links, lists, code blocks, GFM tables) and inserted at the cursor. If the clipboard has no HTML (e.g. plain text copied from a terminal), it falls back to a normal paste. On Linux the command needs xclip or wl-clipboard. Set paste_download_images to true to download remote images locally into media/ (off by default).

Edit the file — the browser updates in place (SSE), scroll is kept. Press the shortcut again to focus the existing tab (does not stack another tab). Switching a preview tab in the browser focuses the matching Sublime view, and the other way around.

If you paste a preview URL into a new browser tab, the old tab for that file is replaced (Chrome may block window.close() on tabs you created yourself; those show a banner instead). The local server stays up while any preview tab is open, and stops shortly after the last one closes.

Preview sidebar toolbar: 📋 copy as rich text, 🖼️ PNG snapshot, 💾 standalone HTML, 📽️ presentation, 🌙 / ☀️ dark mode, ☕ tip.

Hover any code block in the preview for a Copy button. Copy as rich text puts the rendered HTML on the clipboard (browser button, or MarkdownPreviewEnhanced: Copy as Rich Text in the Command Palette) so it can be pasted into mail, Word, or Confluence with styling intact. On Linux the command needs xclip or wl-copy; the browser button works everywhere.

Dark mode follows prefers-color-scheme until you toggle it; the choice is stored in the browser. Mermaid uses its dark theme with the page. Click a Mermaid diagram to enlarge it (drag to pan, scroll wheel to zoom, Esc to close). Clicking a line in Sublime scrolls that block to the middle of the preview (including lines inside a Mermaid fence).

Plain images in the preview open the same zoom overlay on click. GFM task-list checkboxes are clickable: toggling one writes - [ ] / - [x] back to the file (local-server mode). GitHub-style callouts (> [!NOTE] / TIP / IMPORTANT / WARNING / CAUTION, optional custom title after the type), strikethrough ~~text~~, highlight ==text==, superscript ^text^ and subscript ~text~ render in preview and exports.

Presentation mode

Open from the 📽️ button or MarkdownPreviewEnhanced: Presentation Mode. Slides are built from the same rendered HTML as live preview (headings, code, tables, KaTeX, Mermaid, ECharts). A new slide starts at every h1h4. Navigate with arrow keys, click the left/right edges, or the HUD. Canvas is 16:9, scaled to the window.

Settings

Preferences → Package Settings → MarkdownPreviewEnhanced → Settings

Setting Default Description
mermaid_theme "default" Export / file-mode diagrams: default / dark / forest / neutral. Live preview follows the page theme.
output_dir "" Empty = Sublime cache
use_local_server true SSE, images, scroll sync
server_port 8765 Tries the next ports if busy
server_idle_seconds 0 Idle auto-stop; 0 = until Close / Sublime exit
browser "auto" auto / chrome / safari / firefox / edge / …
debounce_ms 500 Re-render delay while typing
show_toc true TOC sidebar
enable_katex true $...$ / $$...$$
enable_emoji true GFM emoji shortcodes (:smile:)
enable_task_lists true - [ ] / - [x]
enable_footnotes true [^1]
strip_frontmatter true Strip leading --- YAML
scroll_sync true Editor ↔ preview (needs local server)
paste_download_images false Paste as markdown: download remote images to media/
paste_images_dir "media" Subdirectory for downloaded images (relative to md file)
custom_css "" Extra CSS file path (~ ok)
embed_images true Export HTML/PDF: embed local images as base64 so output is fully portable
favicon "" Empty = bundled icon; "none" = no icon; otherwise a local path or http(s) URL

Per-view override:

{
    "markdown_preview_enhanced.mermaid_theme": "forest"
}

Requires Sublime Text 4 (Build 4107+). Math, diagrams, and highlighting are vendored — nothing else to install.

Build / PR notes: CONTRIBUTING.md

Support

If this package is useful:

WeChat 赞赏码

License

MIT — LICENSE

Results

Packages