From b473cc6d15ce888c1149dcb69d8ae7d6ffd1c3f6 Mon Sep 17 00:00:00 2001 From: ray Date: Fri, 12 Dec 2025 01:17:07 +0000 Subject: [PATCH] Add toggle for diagnostic display in keymaps This change introduces a new keymap to toggle the display of diagnostics, enhancing user control over diagnostic visibility. --- lua/keymaps.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 2a254b2..595335d 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -46,6 +46,9 @@ end, { desc = 'Diagnostics: All errors (quickfix)', silent = true }) map('n', '[d', vim.diagnostic.goto_prev, { desc = 'Diagnostics: Previous diagnostic', silent = true }) map('n', ']d', vim.diagnostic.goto_next, { desc = 'Diagnostics: Next diagnostic', silent = true }) map('n', 'xd', vim.diagnostic.open_float, { desc = 'Diagnostics: Show diagnostic under cursor', silent = true }) +map('n', 'xt', function() + vim.diagnostic.enable(not vim.diagnostic.is_enabled()) +end, { desc = 'Diagnostics: Toggle display', silent = true }) -- Debug: Show highlight group and color under cursor map('n', 'hi', function()