Skip to content

Commit

Permalink
fix: dont lazy-load on ft. Load on cmd or keys only
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 14, 2023
1 parent 6b9ee96 commit 3a93757
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions lua/lazyvim/plugins/extras/lang/markdown.lua
Original file line number Diff line number Diff line change
@@ -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 = {
{
"<leader>cp",
ft = "markdown",
"<cmd>MarkdownPreviewToggle<cr>",
desc = "Peek (Markdown Preview)",
},
},
config = function()
vim.cmd([[do FileType]])
end,
},
}

0 comments on commit 3a93757

Please sign in to comment.