A powerful VS Code extension that provides Shiki-based Markdown preview functionality with support for 60+ syntax highlighting themes.
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Shiki Markdown Preview"
- Click Install
Or install directly from the marketplace:
- 🎨 Rich Theme Selection: Support for 60+ Shiki themes, including light and dark themes
- ⌨️ Interactive Theme Picker: Use keyboard arrow keys to preview different themes in real-time
- 📝 Code Syntax Highlighting: Integrated Shiki syntax highlighting for all programming languages, with code copy support
- 🔗 Bidirectional Scroll Sync: Real-time scroll synchronization between editor and preview area
- 📱 Responsive Design: Adaptive layout for different screen sizes
- 🎯 Auto-generated TOC: Auto-generated Notion-style table of contents
- 🖼️ Image Lazy Loading: Optimized image loading for better performance
- 📊 Mermaid Support: Built-in support for Mermaid diagrams
- 🧮 Math Support: LaTeX math rendering with KaTeX
vscode >= 1.100.0
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Shiki Markdown Preview"
- Click Install
- Open a Markdown file
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Type "Shiki Markdown Preview"
- Select "Open Markdown Preview Slide" or "Open Markdown Preview Full"
- Side Preview:
Ctrl+Shift+V(Windows/Linux) orCmd+Shift+V(Mac) - Full Preview:
Ctrl+K V(Windows/Linux) orCmd+K V(Mac) - Theme Selection:
Ctrl+Shift+T(Windows/Linux) orCmd+Shift+T(Mac)
The extension supports 60+ beautiful themes. You can switch themes in several ways:
- Open the theme picker with
Ctrl+Shift+T(orCmd+Shift+Ton Mac) - Use arrow keys to navigate through themes
- Press Enter to select a theme
You can customize the extension behavior through VS Code settings:
{
"shikiMarkdownPreview.currentTheme": "vitesse-dark",
"shikiMarkdownPreview.documentWidth": "800px",
"shikiMarkdownPreview.fontFamily": "inherit",
"shikiMarkdownPreview.enableScrollSync": true
}| Setting | Type | Default | Description |
|---|---|---|---|
shikiMarkdownPreview.currentTheme |
string | "vitesse-dark" |
Current theme for markdown preview |
shikiMarkdownPreview.documentWidth |
string | "800px" |
Document width (supports CSS units) |
shikiMarkdownPreview.fontFamily |
string | "inherit" |
Font family for preview |
shikiMarkdownPreview.enableScrollSync |
boolean | true |
Enable scroll synchronization |
px- Pixels%- Percentagerem- Root em unitsem- Em unitsvw- Viewport widthch- Character unitsex- X-height unitscm,mm,in,pt,pc- Physical units
- Real-time synchronization between editor and preview
- Smooth scrolling experience
- Maintains scroll position when switching themes
- Auto-generated TOC with anchor links
- Collapsible sections
- Smooth scrolling to sections
- Lazy loading for better performance
- Support for relative and absolute paths
- Error handling for missing images
- Syntax highlighting for 60+ languages
- Line numbers support
- Copy code functionality
- Language detection
- LaTeX math rendering with KaTeX
- Inline and block math support
- Math syntax highlighting
- Mermaid diagram rendering
- Flowcharts, sequence diagrams, and more
- Syntax highlighting for diagram code
- Node.js 18+
- VS Code 1.100.0+
- TypeScript 5.9.2+
npm install
npm run compilenpm run compile- Compile TypeScriptnpm run watch- Watch mode for developmentnpm run lint- Run ESLintnpm run lint:fix- Fix ESLint issuesnpm run ext:package- Package extension
src/
├── index.ts # Main extension entry point
├── services/ # Core services
│ ├── config/ # Configuration management
│ ├── renderer/ # Markdown rendering
│ ├── scroll-sync/ # Scroll synchronization
│ ├── state/ # State management
│ └── theme/ # Theme management
├── types/ # TypeScript type definitions
├── utils/ # Utility functions
└── webview/ # Webview components
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Shiki - Beautiful syntax highlighter
- VS Code - The amazing editor
- Markdown-it - Markdown parser
- All the theme authors and contributors
Available on VS Code Marketplace: Shiki Markdown Preview
Made with ❤️ for the VS Code community




