From 33e482e67592d5f62be5b09ddead88ce5bdef608 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Fri, 3 Jan 2025 18:27:07 +0100 Subject: [PATCH] Fix diagnostic mapping --- nvim/lua/settings.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index 276f42d..ffcf282 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -62,8 +62,11 @@ vim.keymap.set({ "n", "x" }, "P", '"+P', { desc = "Past line from system -- Quickfix list vim.keymap.set("n", "q", "cclose", { desc = "Close quickfix" }) vim.keymap.set("n", "grd", function() - vim.diagnostics.setqflist({ severity = { min = vim.diagnostics.severity.WARN } }) + vim.diagnostic.setqflist({ severity = { min = vim.diagnostic.severity.WARN } }) end, { desc = "Open diagnostics" }) +vim.keymap.set("n", "gre", function() + vim.diagnostic.setqflist({ severity = vim.diagnostic.severity.ERROR }) +end, { desc = "List errors" }) -- Center screen after navigating (those are builtin shortcuts) vim.keymap.set("n", "[q", "cprevzvzz", { desc = "Previous quickfix item" }) @@ -119,8 +122,8 @@ vim.api.nvim_create_autocmd("FileType", { desc = "Disable comment continuation (enter or o/O)", group = vim.api.nvim_create_augroup("comment-ro", { clear = true }), callback = function() - vim.opt.formatoptions:remove({"r", "o"}) - vim.opt_local.formatoptions:remove({"r", "o"}) + vim.opt.formatoptions:remove({ "r", "o" }) + vim.opt_local.formatoptions:remove({ "r", "o" }) end, })