nvim: Change markdown_preview build process
This commit is contained in:
parent
3c76341341
commit
192b290e4a
@ -1,5 +1,5 @@
|
||||
return {
|
||||
{
|
||||
-- Install markdown preview, use npx if available.
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = {
|
||||
"MarkdownPreviewToggle",
|
||||
@ -9,7 +9,19 @@ return {
|
||||
ft = {
|
||||
"markdown"
|
||||
},
|
||||
build = function() vim.fn["mkdp#util#install"]() end
|
||||
build = function(plugin)
|
||||
if vim.fn.executable "npx" then
|
||||
vim.cmd("!cd " .. plugin.dir .. " && cd app && npx --yes yarn install")
|
||||
else
|
||||
vim.cmd [[Lazy load markdown-preview.nvim]]
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end
|
||||
end,
|
||||
init = function()
|
||||
if vim.fn.executable "npx" then
|
||||
vim.g.mkdp_filetypes = {
|
||||
"markdown"
|
||||
}
|
||||
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user