Instantly preview markdown files in a browser window as you type. This plugin is a Neovim-first (and possibly Vim compatible) Lua port of the vim-instant-markdown Plugin.
Quick start (assuming you have all the necessary dependencies):
-
Install the mini-server by running either:
[sudo] npm -g install instant-markdown-d
or the following command for the Python mini-server (which also requires [pandoc][pandoc] to render markdown):
pip install --user smdv
-
Add the following to your
.vimrc
, depending on the plugin manager of your choice:-
-- in init.lua -- within require("lazy").setup({ { 'instant-markdown/instant-markdown.nvim', dependencies = { 'nvim-lua/plenary.nvim' } }
-
TODO: other package managers.
-
Overriding default configuration with lazy.nvim:
{
'instant-markdown/instant-markdown.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
opts = {
mathjax = true,
mermaid = true,
}
}
- Slow mode (render only on save)
- Autostart preview when markdown files are opened
- Mathjax for equations
- Mermaid.js for charts
- Autoscroll when going into insert mode
- Light and dark themes
Running tests requires plenary.nvim to be checked out in the parent directory of this repository. You can then run:
nvim --headless --noplugin -u tests/minimal.vim -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/minimal.vim'}"
Or if you want to run a single test file:
nvim --headless --noplugin -u tests/minimal.vim -c "PlenaryBustedDirectory tests/path_to_file.lua {minimal_init = 'tests/minimal.vim'}"