Add ]e mappings

This commit is contained in:
2025-01-17 12:10:41 +01:00
parent c6c2cb83e3
commit a6d84302e0

View File

@@ -40,7 +40,7 @@ vim.opt.completeopt = { "menuone", "popup", "noinsert", "fuzzy" }
vim.opt.pumheight = 15
vim.opt.spelloptions = { "camel", "noplainbuffer" }
vim.opt.spelllang = { "en", "programming", "cjk", }
vim.opt.spelllang = { "en", "cjk", }
vim.opt.spell = true
-- Can't specify this in wordmotion's config due to race conditions
@@ -92,6 +92,14 @@ vim.keymap.set("n", "gre", function()
vim.diagnostic.setqflist({ severity = vim.diagnostic.severity.ERROR })
end, { desc = "List errors" })
-- Next error
vim.keymap.set("n", "[e", function()
vim.diagnostic.jump({ count = -1, severity = vim.diagnostic.severity.ERROR })
end, { desc = "Previous error" })
vim.keymap.set("n", "]e", function()
vim.diagnostic.jump({ count = 1, severity = vim.diagnostic.severity.ERROR })
end, { desc = "Next error" })
-- Center screen after navigating (those are builtin shortcuts)
vim.keymap.set("n", "[q", "<cmd>cprev<cr>zvzz", { desc = "Previous quickfix item" })
vim.keymap.set("n", "]q", "<cmd>cnext<cr>zvzz", { desc = "Next quickfix item" })