A Neovim plugin renders markdown file in terminal buffer.
This plugin relies on Glow, only work under Linux or Mac.
markdown-preview.mp4
- Open terminal buffer in different direction:
vertical
,horizontal
. - Support auto refresh when file content changed.
- Install Glow
-- Lua
use {
'0x00-ketsu/markdown-preview.nvim',
ft = {'md', 'markdown', 'mkd', 'mkdn', 'mdwn', 'mdown', 'mdtxt', 'mdtext', 'rmd', 'wiki'},
config = function()
require('markdown-preview').setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the setup section below
},
end
}
-- Lua
require('lazy').setup({
'0x00-ketsu/markdown-preview.nvim',
ft = {'md', 'markdown', 'mkd', 'mkdn', 'mdwn', 'mdown', 'mdtxt', 'mdtext', 'rmd', 'wiki'},
config = function()
require('markdown-preview').setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the setup section below
},
end
})
Following defaults:
local mp = require('markdown-preview')
mp.setup(
{
glow = {
-- When find executable path of `glow` failed (from PATH), use this value instead
exec_path = '',
style = '', -- Path to glamour JSON style file
},
-- Markdown preview term
term = {
-- reload term when rendered markdown file changed
reload = {
enable = true,
events = {'InsertLeave', 'TextChanged'},
},
direction = 'vertical', -- choices: vertical / horizontal
keys = {
close = {'q', '<Esc>'},
refresh = 'r',
}
}
}
)
:MPToggle
: toggle markdown preview open or close.:MPOpen
: open markdown preview window.:MPClose
: close markdown preview window.:MPRefresh
: refresh markdown preview window.
MIT