-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix markdown preview plugin loaded from LazyExtras
There was an error when installing https://github.com/iamcco/markdown-preview.nvim through plugins in LazyVim through LazyExtras. This commit applies a fix found in an issue opened for the error. Related issues: iamcco/markdown-preview.nvim#690 Fixes pull request (not merged yet at time of writing): LazyVim/LazyVim#4196
- Loading branch information
Showing
2 changed files
with
25 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
return { | ||
{ | ||
-- Install markdown preview, use npx if available. | ||
"iamcco/markdown-preview.nvim", | ||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, | ||
ft = { "markdown" }, | ||
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, | ||
}, | ||
} |