From 5e2334fc33da8d99674fc1abdf786aedaba75913 Mon Sep 17 00:00:00 2001 From: xfy Date: Thu, 28 May 2026 17:39:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E9=99=A4=20.git=20=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6=E6=9F=A5=E6=89=BE=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 ff(文件查找)和 fa(查找所有文件)的 rg 命令中 添加 --glob "!.git/" 参数,避免搜索结果中出现 .git 目录下的内部文件。 Co-Authored-By: Claude Opus 4.7 (1M context) --- lua/pack.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/pack.lua b/lua/pack.lua index c540849..612ecc9 100644 --- a/lua/pack.lua +++ b/lua/pack.lua @@ -331,7 +331,7 @@ end, { desc = "诊断位置列表" }) -- ff :文件查找 lazy.on_keys("pick", "ff", "n", pick.load_pick, function() require("mini.pick").builtin.cli({ - command = { "rg", "--files", "--hidden", "--color=never" }, + command = { "rg", "--files", "--hidden", "--glob", "!.git/", "--color=never" }, }) end, { desc = "文件查找" }) @@ -348,7 +348,7 @@ end, { desc = "搜索键位映射" }) -- fa :查找所有文件(含隐藏和忽略的文件) lazy.on_keys("pick", "fa", "n", pick.load_pick, function() require("mini.pick").builtin.cli({ - command = { "rg", "--files", "--hidden", "--no-ignore", "--color=never" }, + command = { "rg", "--files", "--hidden", "--no-ignore", "--glob", "!.git/", "--color=never" }, }) end, { desc = "查找所有文件(含隐藏/忽略)" })