feat: add markdown-preview back

This commit is contained in:
Folke Lemaitre 2023-10-14 17:36:06 +02:00
parent c7f1d33434
commit 93f7a72f91
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -42,35 +42,23 @@ return {
}, },
}, },
-- Markdown preview (requires deno) -- Markdown preview
{ {
"toppair/peek.nvim", "iamcco/markdown-preview.nvim",
enabled = function() cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
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 = { keys = {
{ {
"<leader>cp", "<leader>cp",
ft = "markdown", ft = "markdown",
function() "<cmd>MarkdownPreviewToggle<cr>",
local peek = require("peek")
if peek.is_open() then
peek.close()
else
peek.open()
end
end,
desc = "Peek (Markdown Preview)", desc = "Peek (Markdown Preview)",
}, },
}, },
opts = { theme = "light" }, config = function()
vim.cmd([[do FileType]])
end,
}, },
} }