diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index cb2ab95d..e23af81b 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -211,12 +211,12 @@ return { }, { "/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, { ":", "FzfLua command_history", desc = "Command History" }, - { "", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, + { "", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, -- find { "fb", "FzfLua buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, - { "ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, - { "fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" }, + { "ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, + { "fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" }, { "fg", "FzfLua git_files", desc = "Find Files (git-files)" }, { "fr", "FzfLua oldfiles", desc = "Recent" }, { "fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, diff --git a/lua/lazyvim/plugins/extras/editor/telescope.lua b/lua/lazyvim/plugins/extras/editor/telescope.lua index 9d40dcdf..c897d8cf 100644 --- a/lua/lazyvim/plugins/extras/editor/telescope.lua +++ b/lua/lazyvim/plugins/extras/editor/telescope.lua @@ -92,12 +92,12 @@ return { }, { "/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, { ":", "Telescope command_history", desc = "Command History" }, - { "", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, + { "", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, -- find { "fb", "Telescope buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, - { "ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, - { "fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" }, + { "ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, + { "fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" }, { "fg", "Telescope git_files", desc = "Find Files (git-files)" }, { "fr", "Telescope oldfiles", desc = "Recent" }, { "fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, @@ -198,6 +198,12 @@ return { }, }, }, + pickers = { + find_files = { + find_command = { "fd", "--type", "f", "--color", "never", "-E", ".git" }, + hidden = true, + }, + }, } end, }, diff --git a/lua/lazyvim/util/pick.lua b/lua/lazyvim/util/pick.lua index 63037189..7ab2b482 100644 --- a/lua/lazyvim/util/pick.lua +++ b/lua/lazyvim/util/pick.lua @@ -57,7 +57,7 @@ function M.open(command, opts) return LazyVim.error("LazyVim.pick: picker not set") end - command = command or "auto" + command = command ~= "auto" and command or "files" opts = opts or {} opts = vim.deepcopy(opts) @@ -71,21 +71,6 @@ function M.open(command, opts) opts.cwd = LazyVim.root({ buf = opts.buf }) end - local cwd = opts.cwd or vim.uv.cwd() - if command == "auto" then - command = "files" - if - vim.uv.fs_stat(cwd .. "/.git") - and not vim.uv.fs_stat(cwd .. "/.ignore") - and not vim.uv.fs_stat(cwd .. "/.rgignore") - then - command = "git_files" - if opts.show_untracked == nil then - opts.show_untracked = true - opts.recurse_submodules = false - end - end - end command = M.picker.commands[command] or command M.picker.open(command, opts) end