Add :DiagnosticToggle command to quickly (dis,en)able diagnositcs

This commit is contained in:
Kenneth Benzie 2024-11-22 14:20:19 +00:00
parent a13d97f3ff
commit dc78a25253

View File

@ -191,3 +191,8 @@ vim.api.nvim_create_user_command('Tac', function(opts)
vim.api.nvim_buf_set_lines(buffer, line1, line2, true, lines)
end
end, { range = true })
-- :DiagnosticToggle to disable diagnostics when enabled and vise versa.
vim.api.nvim_create_user_command('DiagnosticToggle', function(_)
vim.diagnostic.enable(not vim.diagnostic.is_enabled())
end, {})