Closed Hello-LuisWu closed 1 year ago
return {
{
"iamcco/markdown-preview.nvim",
build = "cd app && npm install",
ft = "markdown",
lazy = true,
keys = { { "gm", "<cmd>MarkdownPreviewToggle<cr>", desc = "Markdown Preview" } },
config = function()
vim.g.mkdp_auto_close = true
vim.g.mkdp_open_to_the_world = false
vim.g.mkdp_open_ip = "127.0.0.1"
vim.g.mkdp_port = "8888"
vim.g.mkdp_browser = ""
vim.g.mkdp_echo_preview_url = true
vim.g.mkdp_page_title = "${name}"
end,
},
}
Woha! Ever since I switched to Lazy I kept getting tslib
errors with node and nearly signed off on using this plugin at all. I was just taking one last look at the issues to see what others were posting and your config absolutely saved me. Thank you, @qizidog!
How install with lazy.nvim (modified from install with package.nvim):
Or with lazy.nvim
Add this in your init.lua or plugins.lua
-- install without yarn or npm
{
"iamcco/markdown-preview.nvim",
build = function() vim.fn["mkdp#util#install"]() end,
}
-- install with yarn or npm
{
"iamcco/markdown-preview.nvim", build = "cd app && npm install", init = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" },
}
安装参数怎么转换成 lazy的??