- A markdown preview plugin written in Lua.
- It uses
luv
library which provides access to the multi-platform support librarylibuv
in Lua code. - It also uses
grip
as a server to translate.md
to.html
.
- You must have
grip
installed in your system, to do so, simply:
pip install grip
With packer.nvim
use("Alighorab/markdown.nvim")
or
use("Alighorab/markdown.nvim", {
config = require("markdown").setup({
server = {
port = "4000", -- Port number
},
browser = {
command = "firefox" -- Choose your browser
args = {} -- arg list if you need
}
})
})
Default options are:
require("markdown").setup({
server = {
enable = true,
port = "${port}", -- Choose port automatically (recommended) or can be any free port
},
browser = {
enable = true,
command = "firefox",
args = {}, -- comma-separated string, e.g., { "-P", "Markdown", "--new-instance" }
}
})
This plugin is still in early stages, you can define a keymap to use it
local markdown = require("markdown")
vim.keymap.set("n", "<leader>ms", function()
markdown.spawn_server()
markdown.spawn_browser()
end)
vim.keymap.set("n", "<leader>mk", function()
markdown.kill_server()
markdown.kill_browser()
end)
I still prefer not to launch browser on opening any markdown but it will be an option soon.
- Close server and browser on buffer close
- Ability to choose free port automatically
- Add autostart option
- See changes at realtime without saving
- Syncronize scrolling