From 603f04c7d82cbeb795e6d3c0d76ad2b37b4e6375 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Thu, 25 Apr 2024 18:03:07 +0200 Subject: [PATCH] Toggle diagnostics --- init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.lua b/init.lua index f179ee8..e8921e7 100644 --- a/init.lua +++ b/init.lua @@ -190,6 +190,17 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +-- Toggle diagnostics +vim.keymap.set('n', 'td', function() + if vim.diagnostic.is_disabled() then + vim.diagnostic.enable() + print 'Diagnostics are enabled' + else + vim.diagnostic.disable() + print 'Diagnostics are disabled' + end +end, { desc = '[T]oggle [D]iagnostics' }) + -- Toggle spell checking vim.keymap.set('n', 'ts', function() vim.opt.spell = not vim.o.spell