A lightweight Vim plugin that provides markdown preview using glow - the glamorous command-line markdown renderer.
I enjoy spending my time writing and working in Vim. Every time I wanted to see how it looked rendered, I had to break my concentration. Other plugins require spinning up Node servers and switching to a browser - which completely kills my focus when I'm deep in writing documentation.
I wanted to see my markdown rendered without leaving my terminal. So I built this using glow, which renders beautiful markdown right in the terminal in a split view. Now I can toggle a preview, see exactly how my writing looks, and get back to work without losing my train of thought or changing windows.
- Toggle markdown preview with a simple key mapping
- Beautiful rendering powered by glow's terminal-based styling
- Split window layout - preview opens in a vertical split
- Terminal-based - works entirely within your terminal environment
- Vim with terminal support (Vim 8.0+ or Neovim)
- glow command-line tool
Copy markdown-preview.vim to your Vim plugin directory:
- \mp - Toggle markdown preview on/off
- :MarkdownPreviewToggle - Toggle the markdown preview
- q - Close the preview and return to your markdown file
- Open a markdown file in Vim
- Press \mp to open the preview in a vertical split
- The preview renders your current buffer content using glow
- Press q in the preview window to close it
- Toggle again with \mp to reopen with updated content
The plugin works out of the box, but you can customize the key mapping if desired:
The plugin beautifully renders various complex markdown elements through glow:
Syntax Highlighting | ✅ | Supports 200+ languages |
Tables | ✅ | Auto-formatted |
Math | ✅ | LaTeX-style rendering |
Mermaid Diagrams | ✅ | Flowcharts, sequences, etc. |
Mermaid diagrams are not supported yet by glow as they do not yet support rendering mermaid diagrams in ASCII. You can ask glow to support this feature by upvoting this issue.
- Basic markdown rendering
- Syntax highlighting
- Table support
- Plugin customization options
- Key mapping configuration
- Theme selection
- Window size options
Note: This plugin leverages glow's powerful rendering engine to display all these elements beautifully in your terminal.
Warning: Make sure glow is installed for the best experience.
All of these elements render with proper styling, colors, and formatting thanks to glow's terminal-based rendering engine.
If glow is not installed or terminal support is unavailable, the plugin falls back to displaying the raw markdown content in a split window.
- glow by Charm - The beautiful terminal markdown renderer that powers this plugin
- Charm - For creating amazing terminal-based tools
MIT License - feel free to use, modify, and distribute as you see fit.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.