From b3d46bc0141c23bfd4302718ff42dfa172c6952b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Koz=C5=82owicz?= Date: Sat, 14 Oct 2023 17:42:02 +0200 Subject: [PATCH] feat(lang): add markdown support (#1718) * feat(lang): add markdown support * feat: use peek.nvim instead of markdown-preview. Disable and show warning when deno is not installed * feat: add markdown-preview back --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/extras/lang/markdown.lua | 64 ++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/markdown.lua diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua new file mode 100644 index 00000000..123f92bf --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -0,0 +1,64 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "markdown", "markdown_inline" }) + end + end, + }, + { + "williamboman/mason.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "markdownlint" }) + end, + }, + { + "nvimtools/none-ls.nvim", + optional = true, + opts = function(_, opts) + local nls = require("null-ls") + opts.sources = vim.list_extend(opts.sources or {}, { + nls.builtins.diagnostics.markdownlint, + }) + end, + }, + { + "mfussenegger/nvim-lint", + optional = true, + opts = { + linters_by_ft = { + markdown = { "markdownlint" }, + }, + }, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + marksman = {}, + }, + }, + }, + + -- Markdown preview + { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = function() + vim.fn["mkdp#util#install"]() + end, + keys = { + { + "cp", + ft = "markdown", + "MarkdownPreviewToggle", + desc = "Peek (Markdown Preview)", + }, + }, + config = function() + vim.cmd([[do FileType]]) + end, + }, +}