mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat: use peek.nvim instead of markdown-preview. Disable and show warning when deno is not installed
This commit is contained in:
parent
2893ad1b41
commit
c7f1d33434
1 changed files with 29 additions and 5 deletions
|
|
@ -41,12 +41,36 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Markdown preview (requires deno)
|
||||||
{
|
{
|
||||||
"iamcco/markdown-preview.nvim",
|
"toppair/peek.nvim",
|
||||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
enabled = function()
|
||||||
ft = { "markdown" },
|
if vim.fn.executable("deno") == 1 then
|
||||||
build = function()
|
return true
|
||||||
vim.fn["mkdp#util#install"]()
|
end
|
||||||
|
require("lazyvim.util").warn({
|
||||||
|
"`peek.nvim` requires `deno` to be installed.\n",
|
||||||
|
"To hide this message, install `deno` or disable the `toppair/peek.nvim` plugin.",
|
||||||
|
}, { title = "LazyVim Extras `lang.markdown`" })
|
||||||
|
return false
|
||||||
end,
|
end,
|
||||||
|
build = "deno task --quiet build:fast",
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>cp",
|
||||||
|
ft = "markdown",
|
||||||
|
function()
|
||||||
|
local peek = require("peek")
|
||||||
|
if peek.is_open() then
|
||||||
|
peek.close()
|
||||||
|
else
|
||||||
|
peek.open()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = "Peek (Markdown Preview)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = { theme = "light" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue