From 8eacffaa833c2747bad64afeee9d56c893c89fd2 Mon Sep 17 00:00:00 2001 From: caprain Date: Mon, 11 May 2026 21:19:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AB=98=E4=BA=AE=E5=BD=93=E5=89=8D=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=89=80=E6=9C=89=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/pack/configs/illuminate.lua | 16 ++++++++++++++++ lua/pack/plugins.lua | 2 ++ nvim-pack-lock.json | 4 ++++ 3 files changed, 22 insertions(+) create mode 100644 lua/pack/configs/illuminate.lua diff --git a/lua/pack/configs/illuminate.lua b/lua/pack/configs/illuminate.lua new file mode 100644 index 0000000..5a5cd0b --- /dev/null +++ b/lua/pack/configs/illuminate.lua @@ -0,0 +1,16 @@ +-- === 插件描述 === +if vim.g.vscode then return end + +vim.keymap.set( + "n", + "g=", + "lua require('illuminate').goto_next_reference(true)", + { noremap = true, silent = true, desc = "Go to next reference" } +) +-- 将光标移动到上一个引用 +vim.keymap.set( + "n", + "g-", + "lua require('illuminate').goto_prev_reference(true)", + { noremap = true, silent = true, desc = "Go to previous reference" } +) diff --git a/lua/pack/plugins.lua b/lua/pack/plugins.lua index 9e70748..d0f500a 100644 --- a/lua/pack/plugins.lua +++ b/lua/pack/plugins.lua @@ -22,6 +22,8 @@ local specs = { 'https://github.com/lukas-reineke/indent-blankline.nvim', -- rainbowdelimiters.lua 彩虹括号 'https://github.com/HiPhish/rainbow-delimiters.nvim', + -- illuminate.lua 高亮所有引用 + 'https://github.com/RRethy/vim-illuminate', -- gitsigns.lua 突出增、删、改过的行 'https://github.com/lewis6991/gitsigns.nvim', -- ufo.lua 折叠插件 diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index befeb5b..bd11741 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -121,6 +121,10 @@ "rev": "0e6d41d55ad147407e4ba00a292973de8db0b836", "src": "https://github.com/jiaoshijie/undotree" }, + "vim-illuminate": { + "rev": "0d1e93684da00ab7c057410fecfc24f434698898", + "src": "https://github.com/RRethy/vim-illuminate" + }, "vim-suda": { "rev": "c492741b4679b3cdd4d9e34138209784e061d916", "src": "https://github.com/lambdalisue/vim-suda"