From 58bbe7790cc56b62bb424b5ba630b0b3c7b64773 Mon Sep 17 00:00:00 2001 From: jabuxas Date: Wed, 18 Sep 2024 14:11:30 -0300 Subject: [PATCH] fix: markdown preview on musl --- lua/custom/plugins/md.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lua/custom/plugins/md.lua b/lua/custom/plugins/md.lua index 75a013d..0bfa81e 100644 --- a/lua/custom/plugins/md.lua +++ b/lua/custom/plugins/md.lua @@ -2,5 +2,15 @@ return { "iamcco/markdown-preview.nvim", cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, 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, }