better diagnostic behavior
This commit is contained in:
@@ -111,22 +111,26 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
||||
map("n", "g.", vim.diagnostic.open_float, { desc = "line diagnostics" })
|
||||
map("n", "gl", vim.diagnostic.setloclist, { desc = "diagnostic list" })
|
||||
|
||||
-- diagnostics only on error. g] is used by mini.ai
|
||||
-- diagnostics on warnings and errors.
|
||||
map("n", "]g", function()
|
||||
vim.diagnostic.goto_next({
|
||||
severity = vim.diagnostic.severity.ERROR,
|
||||
severity = {
|
||||
min = vim.diagnostic.severity.WARN,
|
||||
},
|
||||
})
|
||||
end, { desc = "next error" })
|
||||
end, { desc = "next warning/error" })
|
||||
map("n", "[g", function()
|
||||
vim.diagnostic.goto_prev({
|
||||
severity = vim.diagnostic.severity.ERROR,
|
||||
severity = {
|
||||
min = vim.diagnostic.severity.WARN,
|
||||
},
|
||||
})
|
||||
end, { desc = "prev error" })
|
||||
end, { desc = "prev warning/error" })
|
||||
|
||||
map("n", "gle", vim.diagnostic.setloclist, { desc = "display error information" })
|
||||
map("n", "gie", function()
|
||||
map("n", "gld", vim.diagnostic.setloclist, { desc = "display diagnostic information" })
|
||||
map("n", "gid", function()
|
||||
vim.diagnostic.config({ virtual_text = not vim.diagnostic.config().virtual_text })
|
||||
end, { desc = "toggle inline errors" })
|
||||
map("n", "gve", function()
|
||||
end, { desc = "toggle inline diagnostics" })
|
||||
map("n", "gvd", function()
|
||||
vim.diagnostic.config({ virtual_lines = not vim.diagnostic.config().virtual_lines })
|
||||
end, { desc = "toggle virtual line errors" })
|
||||
end, { desc = "toggle virtual line diagnostics" })
|
||||
|
||||
Reference in New Issue
Block a user