From ce8c40e7170b9336a7dc8bf44ff669015ca57ec4 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 1 Dec 2025 09:59:42 +0100 Subject: [PATCH] nvim: Fix diagnostic toggle mappings Finally changed the 'show line diagnostics' (opening a popup with all diagnostics on current line) mapping to fit to the other remappings moving 'diagnostics' to the `e` key, with `le`. And fixed the ability to toggle diagnostics as virtual lines with `lO`. --- nvim/.config/nvim/lua/modules/lsp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/lua/modules/lsp.lua b/nvim/.config/nvim/lua/modules/lsp.lua index 02bd0b1..12d55e6 100644 --- a/nvim/.config/nvim/lua/modules/lsp.lua +++ b/nvim/.config/nvim/lua/modules/lsp.lua @@ -149,7 +149,7 @@ vim.api.nvim_create_autocmd("LspAttach", { o({ desc = "Next error" }) ) - map("n", "ld", "lua vim.diagnostic.open_float()", o({ desc = "Show line diagnostics" })) + map("n", "le", "lua vim.diagnostic.open_float()", o({ desc = "Show line diagnostics" })) map("n", "la", "lua vim.lsp.buf.code_action()", o({ desc = "Codeactions" })) map("n", "ln", "lua vim.lsp.buf.rename()", o({ desc = "Rename element" })) map("n", "lc", "lua vim.lsp.buf.declaration()", o({ desc = "Declaration" })) @@ -166,7 +166,7 @@ vim.api.nvim_create_autocmd("LspAttach", { local c = vim.diagnostic.config() or {} vim.diagnostic.config({ virtual_text = not c["virtual_text"] }) end, o({ desc = "Toggle virtual diag text" })) - if vim.fn.has("nvim-0.11") == true then -- new feature https://gpanders.com/blog/whats-new-in-neovim-0-11/#virtual-lines + if vim.fn.has("nvim-0.11") == 1 then -- new feature https://gpanders.com/blog/whats-new-in-neovim-0-11/#virtual-lines map("n", "lO", function() local c = vim.diagnostic.config() or {} vim.diagnostic.config({ virtual_lines = not c["virtual_lines"] })