feat(lsp): add mapping for toggling diagnostics

This commit is contained in:
2024-10-25 13:31:17 +02:00
parent cc402c74e2
commit e73f7ebb8a
+7
View File
@@ -38,6 +38,13 @@ function M:init(server, bufnr)
{ mode = { "n" }, lhs = "<leader>lr", rhs = vim.lsp.buf.rename }, { mode = { "n" }, lhs = "<leader>lr", rhs = vim.lsp.buf.rename },
{ mode = { "n" }, lhs = "<leader>la", rhs = vim.lsp.buf.code_action }, { mode = { "n" }, lhs = "<leader>la", rhs = vim.lsp.buf.code_action },
{ mode = { "n", "x" }, lhs = "<leader>lf", rhs = vim.lsp.buf.format }, { mode = { "n", "x" }, lhs = "<leader>lf", rhs = vim.lsp.buf.format },
{
mode = { "n" },
lhs = "<leader>ld",
rhs = function()
vim.diagnostic.enable(not vim.diagnostic.is_enabled())
end,
},
{ {
mode = { "n", "i" }, mode = { "n", "i" },
lhs = "<C-l>", lhs = "<C-l>",