diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 7557918f..3c1d507c 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -41,12 +41,36 @@ return { }, }, }, + + -- Markdown preview (requires deno) { - "iamcco/markdown-preview.nvim", - cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, - ft = { "markdown" }, - build = function() - vim.fn["mkdp#util#install"]() + "toppair/peek.nvim", + enabled = function() + if vim.fn.executable("deno") == 1 then + return true + 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, + build = "deno task --quiet build:fast", + keys = { + { + "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" }, }, }