Add markdown linting commands and update keymaps

- Introduced commands to enable/disable automatic markdown linting.
- Updated keymaps to reflect changes in markdown linting behavior.
This commit is contained in:
Ray Elliott 2026-01-05 20:05:21 +00:00
commit c9a7b3b694
3 changed files with 32 additions and 5 deletions

View file

@ -13,7 +13,7 @@ return {
javascriptreact = { "eslint_d" },
typescript = { "eslint_d" },
typescriptreact = { "eslint_d" },
markdown = { "markdownlint" },
-- markdown linting: manual only (see keymap below)
php = { "phpcs" },
-- Python: ruff LSP handles linting
}
@ -78,5 +78,24 @@ return {
lint.try_lint()
end,
})
-- Commands to enable/disable automatic markdown linting
vim.api.nvim_create_user_command("LintMarkdownEnable", function()
lint.linters_by_ft.markdown = { "markdownlint" }
vim.notify("Markdown linting enabled (automatic)", vim.log.levels.INFO)
-- Lint immediately
if vim.bo.filetype == "markdown" then
lint.try_lint()
end
end, { desc = "Enable automatic markdown linting" })
vim.api.nvim_create_user_command("LintMarkdownDisable", function()
lint.linters_by_ft.markdown = nil
vim.notify("Markdown linting disabled", vim.log.levels.INFO)
-- Clear existing diagnostics for markdown buffers
if vim.bo.filetype == "markdown" then
vim.diagnostic.reset(lint.get_namespace("markdownlint"))
end
end, { desc = "Disable automatic markdown linting" })
end,
}