From 631bf1af1d12468655efb472dd2b176a693803f5 Mon Sep 17 00:00:00 2001 From: Matthew Grossman Date: Sun, 7 Jul 2024 21:48:43 -0700 Subject: [PATCH] fix: exclude `.git` for default `fd` command (#221) * Update help file for `fd` * Update finder.lua * Also change for `fdfind` * Update doc/telescope-frecency.txt Co-authored-by: JINNOUCHI Yasushi * Update lua/frecency/finder.lua Co-authored-by: JINNOUCHI Yasushi --------- Co-authored-by: JINNOUCHI Yasushi --- doc/telescope-frecency.txt | 4 ++-- lua/frecency/finder.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/telescope-frecency.txt b/doc/telescope-frecency.txt index e4e4233..7d2e1bf 100644 --- a/doc/telescope-frecency.txt +++ b/doc/telescope-frecency.txt @@ -584,8 +584,8 @@ Type: `"LUA"|string[]|nil` With the default value: `nil`, it uses these ways below to make entries for workspace files. It tries in order until it works successfully. -1. `fdfind -Htf` -2. `fd -Htf` +1. `fdfind -Htf -E .git` +2. `fd -Htf -E .git` 3. `rg -.g '!.git' --files` 4. Native Lua code (old way) diff --git a/lua/frecency/finder.lua b/lua/frecency/finder.lua index 559c18c..bafd9af 100644 --- a/lua/frecency/finder.lua +++ b/lua/frecency/finder.lua @@ -83,7 +83,7 @@ function Finder:start(epoch) if config.workspace_scan_cmd ~= "LUA" and self.need_scan_dir then ---@type string[][] local cmds = config.workspace_scan_cmd and { config.workspace_scan_cmd } - or { { "fdfind", "-Htf" }, { "fd", "-Htf" }, { "rg", "-.g", "!.git", "--files" } } + or { { "fdfind", "-Htf", "-E", ".git" }, { "fd", "-Htf", "-E", ".git" }, { "rg", "-.g", "!.git", "--files" } } for _, c in ipairs(cmds) do ok = self:scan_dir_cmd(c) if ok then