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