diff --git a/lua/lazyvim/plugins/extras/editor/telescope.lua b/lua/lazyvim/plugins/extras/editor/telescope.lua index c897d8cf..11cfef1b 100644 --- a/lua/lazyvim/plugins/extras/editor/telescope.lua +++ b/lua/lazyvim/plugins/extras/editor/telescope.lua @@ -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, }, },