A VSCode extension that provides enhanced markdown preview functionality with GitHub-style rendering, auto-preview capabilities, and intuitive mode switching.
Latest Update: Version 1.5.1 fixes preview title updates, file tree navigation, and double-click file opening in preview mode.
- Smart File Opening: Click any
.mdfile in the file browser- "Preview First" mode: Opens as rendered preview
- "Code First" mode: Opens as raw markdown
- Seamless Mode Switching: Toggle between preview ↔ code in the same panel
- Copy Code Buttons: One-click copy functionality on all code blocks with visual feedback
- Print Support: Browser-based printing with color syntax highlighting and optimized layout
- Live Checkboxes: Click checkboxes in preview to update source markdown automatically
- Text Input Fields: Interactive text inputs using
Label = ___syntax with real-time updates - Save from Preview: Press Ctrl+S (Cmd+S on Mac) to save directly from preview mode
- Mermaid.js Diagrams: Full support for flowcharts, sequence diagrams, and more
- GIF Support: Full animated GIF rendering for both local and remote images
- Enhanced Scroll Sync: Accurate bidirectional scroll synchronization with section-level precision between preview and code editor
- Smart Mode Switching: Preview closure automatically switches to code-first mode
- Animated GIFs: Full support for animated GIF rendering with proper animation
- Local & Remote: Support for both local files and remote URLs
- All Formats: GIF, PNG, JPG, JPEG, SVG, WebP with responsive sizing
- Theme Compatible: Images display in both light and dark themes
- Right-click in Preview:
- Toggle Mode (Preview ↔ Code)
- Toggle Theme (Light/Dark)
- Print Document
- Right-click in Markdown Editor:
- Toggle Mode (Preview ↔ Code)
- Open Preview
- Alt+M / Option+M: Quick toggle between Preview ↔ Code modes
- Command Palette via
Cmd+Shift+P(Mac) /Ctrl+Shift+P(Windows):- "Markdown Previewer: Open Preview"
- "Markdown Previewer: Toggle Mode (Preview ↔ Code)"
- "Markdown Previewer: Toggle Theme (Light/Dark)"
- "Markdown Previewer: Print"
- Clone this repository
- Open in VSCode
- Run
npm installto install dependencies - Press
F5to launch in Extension Development Host - Open any
.mdfile to see the extension in action!
- Open a markdown file - It will automatically open in preview mode (if "Preview First" is set)
- Copy code easily: Hover over any code block and click the "Copy" button that appears
- Add text inputs: Use
Label = ___syntax to create interactive text input fields - Right-click for options:
- In preview: Toggle to code view or switch themes
- In editor: Toggle to preview or open preview panel
- Use keyboard shortcuts: Press Alt+M (Windows/Linux) or Option+M (Mac) to toggle modes
- Use Command Palette:
Cmd+Shift+P→ "Markdown Previewer" commands
The extension provides these settings:
markdownPreviewer.defaultMode: Set default mode ("preview-first" or "code-first")markdownPreviewer.defaultTheme: Set default theme ("light" or "dark")markdownPreviewer.showModeNotifications: Show status messages when switching modes
This project is open source and available under the MIT License.
