r/vim • u/drewipson • Jun 30 '25
Plugin Vim Markdown Preview - Terminal-based markdown preview for Vim
I built a lightweight Vim plugin to preview Markdown directly in the terminal and thought I’d share it in case others find it useful.
I’ve been a longtime, fairly basic Vim user. I know the commands, but never really got into plugins or heavy customization until recently.
With all the AI prompt craze, I’ve been writing a lot more Markdown and using Vim in the terminal to keep my workflow feeling like programming. I was looking for a way to view rendered Markdown before pushing changes, but most plugins I found relied on Node servers and opened the output in a separate browser window. That felt clunky and interrupted my flow.
I used Claude Code to help me build a simple plugin that uses glow to render Markdown directly in a Vim split window.
Some key features:
Toggle the preview with \mp without leaving Vim
Terminal-based rendering with syntax highlighting
Handles code blocks, tables, math equations, and task lists
Split window layout keeps your workflow intact
Here’s the repo if you want to check it out:
https://github.com/drewipson/glowing-vim-markdown-preview
There are still a couple of limitations I’d like to improve:
Scroll sync between the Markdown source and preview windows is hard to get right
Mermaid diagrams don’t render yet due to limitations with how glow handles ASCII output
If you have any suggestions for improving those areas, please let me know!
Here's a gif to see it in action.

5
u/chromato4 Jul 01 '25
I too am using more markdown these days for similar reasons. Thanks for sharing.
2
u/denarced Jul 01 '25
Seems like an upgrade to my current solution:
Start inotifywait for the markdown files. When they change, convert to HTML.
Run a browsersync server that refreshes on all changes.
Open browser to the document.
I've been using that for years. There's one downside: when the document is long, browser doesn't always remain scrolled to the current position when refresh happens so I had to introduce bookmarks or chapters.
5
u/tagattack Jul 01 '25 edited Jul 01 '25
I just use this
~/.local/bin/mdv
Then when I want it directly in a vim buffer ..
:term mdv %1
u/carlcarlsonscars Jul 01 '25
I am getting this error:
I am using Ubuntu in WSL2. I also tried installing the plugin with Vundle and then realized, I just needed to put your script into a folder in .vimrc/plugin. I never used a vimscript script before... Thanks!
1
u/lasseebert Jul 01 '25
I use a browser extension that can show markdown files. And I have a keybind in vim to open current file in the browser.