From e3a11b8d06854d1aac2907c6a50bd60ee727f3bb Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 8 Jan 2025 20:55:14 +0000 Subject: [PATCH] Add keybindings to enable, disable and toggle ...diagnostics --- nvim/lua/opdavies/lsp/init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nvim/lua/opdavies/lsp/init.lua b/nvim/lua/opdavies/lsp/init.lua index e4b4e07..cf59995 100644 --- a/nvim/lua/opdavies/lsp/init.lua +++ b/nvim/lua/opdavies/lsp/init.lua @@ -124,3 +124,11 @@ vim.api.nvim_create_autocmd("LspAttach", { vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { buffer = 0 }) end, }) + +vim.keymap.set("n", "dd", function() + vim.diagnostic.enable(false) +end) + +vim.keymap.set("n", "de", function() + vim.diagnostic.enable(true) +end)