nvim: Change diagnostic movement to ][e

In preparation for adding debugging we change the bracket movement
between diagnostics from `[d`/`]d` to `[e`/`]e` instead.

This will be a big switch in muscle memory for me and I hope I can adapt
to it pretty quickly, but at least mnemonically it still makes sense
since we jump between [E]rrors (or warnings but good enough).
This commit is contained in:
Marty Oehme 2025-06-21 10:46:31 +02:00
parent 8f9954bd8a
commit f558a68976
Signed by: Marty
GPG key ID: 4E535BC19C61886E
2 changed files with 5 additions and 5 deletions

View file

@ -186,7 +186,7 @@ return {
buffer = { suffix = "b", options = {} },
comment = { suffix = "k", options = {} },
conflict = { suffix = "" }, -- disable to use git-conflict instead
diagnostic = { suffix = "d", options = {} },
diagnostic = { suffix = "e", options = {} },
file = { suffix = "", options = {} },
indent = { suffix = "" }, -- disable since we use indentscope
jump = { suffix = "j", options = {} },

View file

@ -134,17 +134,17 @@ vim.api.nvim_create_autocmd("LspAttach", {
local map = vim.keymap.set
map("n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", o({ desc = "Hover definition" }))
map("n", "[d", "<cmd>lua vim.diagnostic.goto_prev()<cr>", o({ desc = "Previous diagnostic" }))
map("n", "]d", "<cmd>lua vim.diagnostic.goto_next()<cr>", o({ desc = "Next diagnostic" }))
map("n", "[e", "<cmd>lua vim.diagnostic.goto_prev()<cr>", o({ desc = "Previous diagnostic" }))
map("n", "]e", "<cmd>lua vim.diagnostic.goto_next()<cr>", o({ desc = "Next diagnostic" }))
map(
"n",
"[D",
"[E",
"<cmd>lua vim.diagnostic.goto_prev({severity = vim.diagnostic.severity.ERROR})<cr>",
o({ desc = "Previous error" })
)
map(
"n",
"]D",
"]E",
"<cmd>lua vim.diagnostic.goto_next({severity = vim.diagnostic.severity.ERROR})<cr>",
o({ desc = "Next error" })
)