From 04e06142c2b3d34ac72b5ec006d651e658220f5c Mon Sep 17 00:00:00 2001 From: Martin Lasson Date: Thu, 30 Jan 2025 20:51:49 +0100 Subject: [PATCH] Fix so definition and diagnostic lsp actions in nvim has reuse_win = true --- nvim/lua/lsp/setup.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nvim/lua/lsp/setup.lua b/nvim/lua/lsp/setup.lua index 68d7467..717d2dc 100644 --- a/nvim/lua/lsp/setup.lua +++ b/nvim/lua/lsp/setup.lua @@ -26,9 +26,12 @@ local function global_on_attach(client, bufnr) utils.add_keymaps({ n = { + ["gd"] = { cmd = function() - vim.lsp.buf.definition() + vim.lsp.buf.definition({ + reuse_win = true, + }) end, opts = { noremap = true, @@ -38,7 +41,9 @@ local function global_on_attach(client, bufnr) }, ["gD"] = { cmd = function() - vim.lsp.buf.declaration() + vim.lsp.buf.declaration({ + reuse_win = true, + }) end, opts = { noremap = true,