From a4d83524a7179274c17414ebeb0a4e4b8d9a8706 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 18 May 2024 15:46:28 +0200 Subject: [PATCH] fix(lsp): move next/prev reference keymaps to lsp keymaps. See #3220 --- lua/lazyvim/plugins/lsp/keymaps.lua | 4 +++- lua/lazyvim/util/lsp.lua | 6 ------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 0f5aecb7..14626afd 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -39,7 +39,9 @@ function M.get() end, desc = "Source Action", has = "codeAction", - } + }, + { "]]", function() LazyVim.lsp.words.jump(vim.v.count1) end, has = "documentHighlight", desc = "Next Reference" }, + { "[[", function() LazyVim.lsp.words.jump(-vim.v.count1) end, has = "documentHighlight", desc = "Next Reference" }, } if LazyVim.has("inc-rename.nvim") then M._keys[#M._keys + 1] = { diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index a4acdc19..e2eb82de 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -158,12 +158,6 @@ function M.words.setup(opts) end end, }) - vim.keymap.set("n", "]]", function() - M.words.jump(vim.v.count1) - end, { buffer = buf, desc = "Next reference" }) - vim.keymap.set("n", "[[", function() - M.words.jump(-vim.v.count1) - end, { buffer = buf, desc = "Previous reference" }) end end) end