From c0d0bd3d3084ad76c2148b887ca5bb5f0d7cf961 Mon Sep 17 00:00:00 2001 From: aloslider <53711835+aloslider@users.noreply.github.com> Date: Sun, 25 Oct 2026 01:57:04 +0300 Subject: [PATCH] [nvim] Remove default diagnostics keybinds; Switch to virtual_lines diagnostics; --- .../nvim/benq/lua/config/diagnostics.lua | 69 ++++++++++--------- dot_config/nvim/benq/lua/config/keymaps.lua | 8 +++ 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/dot_config/nvim/benq/lua/config/diagnostics.lua b/dot_config/nvim/benq/lua/config/diagnostics.lua index a201320..18ad82d 100644 --- a/dot_config/nvim/benq/lua/config/diagnostics.lua +++ b/dot_config/nvim/benq/lua/config/diagnostics.lua @@ -1,43 +1,44 @@ vim.diagnostic.config({ - virtual_text = { - spacing = 2, - source = "if_many", - prefix = "●", - }, - signs = true, - update_in_insert = true, - severity_sort = true, - float = { - border = "rounded", - source = true, - }, - jump = { - wrap = true, - on_jump = function(_, bufnr) - vim.diagnostic.open_float({ - bufnr = bufnr, - scope = "cursor", - focus = false, - }) - end, - }, + virtual_text = false, + virtual_lines = { + spacing = 2, + source = "if_many", + prefix = "●", + }, + signs = true, + update_in_insert = true, + severity_sort = true, + float = { + border = "rounded", + source = true, + }, + jump = { + wrap = true, + on_jump = function(_, bufnr) + vim.diagnostic.open_float({ + bufnr = bufnr, + scope = "cursor", + focus = false, + }) + end, + }, }) vim.fn.sign_define('DapBreakpoint', { - text = '⚪', - texthl = 'DapBreakpointSymbol', - linehl = 'DapBreakpoint', - numhl = 'DapBreakpoint' + text = '⚪', + texthl = 'DapBreakpointSymbol', + linehl = 'DapBreakpoint', + numhl = 'DapBreakpoint' }) vim.fn.sign_define('DapStopped', { - text = '🔴', - texthl = 'yellow', - linehl = 'DapBreakpoint', - numhl = 'DapBreakpoint' + text = '🔴', + texthl = 'yellow', + linehl = 'DapBreakpoint', + numhl = 'DapBreakpoint' }) vim.fn.sign_define('DapBreakpointRejected', { - text = '⭕', - texthl = 'DapStoppedSymbol', - linehl = 'DapBreakpoint', - numhl = 'DapBreakpoint' + text = '⭕', + texthl = 'DapStoppedSymbol', + linehl = 'DapBreakpoint', + numhl = 'DapBreakpoint' }) diff --git a/dot_config/nvim/benq/lua/config/keymaps.lua b/dot_config/nvim/benq/lua/config/keymaps.lua index 78d5d9f..feade23 100644 --- a/dot_config/nvim/benq/lua/config/keymaps.lua +++ b/dot_config/nvim/benq/lua/config/keymaps.lua @@ -56,6 +56,14 @@ vim.keymap.set("n", "-", "split", { desc = "Split window horizonta vim.keymap.set("n", "|", "vsplit", { desc = "Split window vertically" }) -- Diagnostics +vim.keymap.del("n", "d") -- remove default +vim.keymap.del("n", "") -- remove default +vim.keymap.set("n", "bvl", + function() + local new_config = not vim.diagnostic.config().virtual_lines + vim.diagnostic.config({ virtual_lines = new_config }) + end, + { desc = "Toggle diagnostic virtual_lines for buffer" }) vim.keymap.set("n", "ld", vim.diagnostic.open_float, { desc = "Show line diagnostics" }) vim.keymap.set("n", "]d", function() vim.diagnostic.jump({ count = vim.v.count1 }) end, { desc = "Next diagnostic" }) vim.keymap.set("n", "[d", function() vim.diagnostic.jump({ count = -vim.v.count1 }) end, { desc = "Previous diagnostic" })