filter project diagnostics by defualt

This commit is contained in:
2026-08-31 18:58:22 +02:00
parent 124c108a70
commit 26293351e3
2 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -119,7 +119,7 @@ Diagnostics:
- `[g` jump to previous warning or error
- `<leader>ti` toggle inline diagnostics
- `<leader>tv` toggle virtual diagnostics
- `<leader>xx` toggle project diagnostics with `:Trouble diagnostics toggle`
- `<leader>xx` toggle project warnings and errors
## Tree-sitter
+11 -1
View File
@@ -125,7 +125,17 @@ vim.api.nvim_create_autocmd("LspAttach", {
})
-- diagnostics
map("n", "<leader>xx", "<Cmd>Trouble diagnostics toggle<CR>", { desc = "toggle project diagnostics" })
map("n", "<leader>xx", function()
require("trouble").toggle({
mode = "diagnostics",
filter = {
severity = {
vim.diagnostic.severity.ERROR,
vim.diagnostic.severity.WARN,
},
},
})
end, { desc = "toggle project warnings and errors" })
map("n", "g.", vim.diagnostic.open_float, { desc = "line diagnostics" })
map("n", "gl", vim.diagnostic.setloclist, { desc = "diagnostic list" })