From 0fb67acc3dd5e5e2d1ed7e229a8ce5c733e59611 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Thu, 20 Aug 2026 15:26:41 -0400 Subject: [PATCH] feat(core): add LSP reference navigation keymaps and drop octo.nvim import --- lua/community.lua | 1 - lua/polish.lua | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lua/community.lua b/lua/community.lua index 793bdb2..511e07d 100644 --- a/lua/community.lua +++ b/lua/community.lua @@ -11,7 +11,6 @@ return { { import = "astrocommunity.editing-support.refactoring-nvim" }, { import = "astrocommunity.editing-support.conform-nvim" }, { import = "astrocommunity.diagnostics.trouble-nvim" }, - { import = "astrocommunity.git.octo-nvim" }, { import = "astrocommunity.pack.mdx" }, { import = "astrocommunity.pack.biome" }, { import = "astrocommunity.pack.go" }, diff --git a/lua/polish.lua b/lua/polish.lua index cbcd1d6..ef09175 100644 --- a/lua/polish.lua +++ b/lua/polish.lua @@ -1,2 +1,18 @@ -- This will run last in the setup process. -- Pure lua; anything that doesn't fit the normal config locations goes here. + +-- Snacks.keymap: LSP-aware keymaps, only applied to buffers with a client +-- that supports the given method (which-key picks up the desc). ]] and [[ +-- cycle through the LSP references that snacks.words auto-highlights, +-- complementing the core astrolsp `gd` / `gr` binds. +local ok, snacks = pcall(require, "snacks") +if ok then + snacks.keymap.set("n", "]]", function() snacks.words.jump(vim.v.count1, true) end, { + lsp = { method = "textDocument/documentHighlight" }, + desc = "Next reference", + }) + snacks.keymap.set("n", "[[", function() snacks.words.jump(-vim.v.count1, true) end, { + lsp = { method = "textDocument/documentHighlight" }, + desc = "Previous reference", + }) +end