fix(telescope): better find_command. Fixes #4031
This commit is contained in:
@ -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,
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user