commit 23a840df3e6c71ecc3314c84f290c129d4f7109b
parent 108dd50602569a7374844f09cd7935b1a57dbb87
Author: Chris Bracken <chris@bracken.jp>
Date: Sun, 25 Aug 2024 17:44:16 -0700
vim: add keymapping to toggle diagnostics
Diffstat:
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/.config/nvim/lua/config/keymaps.lua b/.config/nvim/lua/config/keymaps.lua
@@ -22,6 +22,11 @@ vim.keymap.set('n', '<leader>l', '<cmd>FzfLua live_grep<CR>')
vim.keymap.set('n', '<leader>c', '<cmd>FzfLua builtin commands<CR>')
vim.keymap.set('n', '<leader>q', function() vim.diagnostic.setqflist() end)
+-- Toggle diagnostics.
+vim.keymap.set('n', '<leader>d', function()
+ vim.diagnostic.enable(not vim.diagnostic.is_enabled())
+end, { silent = true })
+
-- Key mapping to toggle absolute/relative numbering.
vim.keymap.set('n', '<leader>n', function()
local opt = vim.opt
diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua
@@ -35,9 +35,4 @@ vim.api.nvim_create_autocmd('FileType', {
})
-- Don't show warnings, errors, etc. by default.
-vim.diagnostic.config({
- virtual_text = false,
- signs = false,
- underline = false,
- update_in_insert = false,
-});
+vim.diagnostic.enable(false)