Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
---@type LazySpec
return {
"iamcco/markdown-preview.nvim",
build = function(plugin)
local package_manager = vim.fn.executable "yarn" and "yarn" or vim.fn.executable "npx" and "npx -y yarn" or false

--- HACK: Use `yarn` or `npx` when possible, otherwise throw an error
---@see https://github.com/iamcco/markdown-preview.nvim/issues/690
---@see https://github.com/iamcco/markdown-preview.nvim/issues/695
if not package_manager then error "Missing `yarn` or `npx` in the PATH" end

local cmd = string.format(
"!cd %s && cd app && COREPACK_ENABLE_AUTO_PIN=0 %s install --frozen-lockfile",
plugin.dir,
package_manager
)

vim.cmd(cmd)
end,
build = function() vim.fn["mkdp#util#install"]() end,
ft = { "markdown", "markdown.mdx" },
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
init = function()
Expand Down