mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 17:03:39 +02:00
fix(telescope): better find_command. Fixes #4031
This commit is contained in:
parent
45af7e1fed
commit
d39cdb0596
1 changed files with 15 additions and 1 deletions
|
@ -165,6 +165,20 @@ return {
|
||||||
LazyVim.pick("find_files", { hidden = true, default_text = line })()
|
LazyVim.pick("find_files", { hidden = true, default_text = line })()
|
||||||
end
|
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 {
|
return {
|
||||||
defaults = {
|
defaults = {
|
||||||
prompt_prefix = " ",
|
prompt_prefix = " ",
|
||||||
|
@ -200,7 +214,7 @@ return {
|
||||||
},
|
},
|
||||||
pickers = {
|
pickers = {
|
||||||
find_files = {
|
find_files = {
|
||||||
find_command = { "fd", "--type", "f", "--color", "never", "-E", ".git" },
|
find_command = find_command,
|
||||||
hidden = true,
|
hidden = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue