Whenever you open a .md file, Neovim will prompt you to open a live preview in your browser. The preview syncs to your buffer as you type.
- Neovim 0.12+
- Git
- Node.js
-
Back up your existing config (if you have one):
mv ~/.config/nvim/init.vim ~/.config/nvim/init.vim.bak -
Create
~/.config/nvim/init.luawith the contents ofinit.luain this gist.The options block at the top reflects my personal settings — adjust or remove them as you like.
-
Open Neovim — lazy.nvim will install itself and the plugin automatically on first launch.
-
Open any
.mdfile — you'll be prompted:Open Markdown Preview? [Y]es, (N)o:Press
yto open a synced browser preview,nor Enter to skip.
Once the plugin is loaded you can also control the preview directly:
| Command | Action |
|---|---|
:MarkdownPreview |
Open preview |
:MarkdownPreviewStop |
Close preview |
:MarkdownPreviewToggle |
Toggle preview |