fix(telescope): better find_command. Fixes #4031

This commit is contained in:
Folke Lemaitre
2024-07-14 18:06:40 +02:00
parent 45af7e1fed
commit d39cdb0596

View File

@ -165,6 +165,20 @@ return {
LazyVim.pick("find_files", { hidden = true, default_text = line })()
end
local function find_command()
if 1 == vim.fn.executable("rg") then
return { "rg", "--files", "--color", "never", "-g", "!.git" }
elseif 1 == vim.fn.executable("fd") then
return { "fd", "--type", "f", "--color", "never", "-E", ".git" }
elseif 1 == vim.fn.executable("fdfind") then
return { "fdfind", "--type", "f", "--color", "never", "-E", ".git" }
elseif 1 == vim.fn.executable("find") and vim.fn.has("win32") == 0 then
return { "find", ".", "-type", "f" }
elseif 1 == vim.fn.executable("where") then
return { "where", "/r", ".", "*" }
end
end
return {
defaults = {
prompt_prefix = "",
@ -200,7 +214,7 @@ return {
},
pickers = {
find_files = {
find_command = { "fd", "--type", "f", "--color", "never", "-E", ".git" },
find_command = find_command,
hidden = true,
},
},