Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
1bf5f15b26 |
@ -211,12 +211,12 @@ return {
|
|||||||
},
|
},
|
||||||
{ "<leader>/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
{ "<leader>/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
||||||
{ "<leader>:", "<cmd>FzfLua command_history<cr>", desc = "Command History" },
|
{ "<leader>:", "<cmd>FzfLua command_history<cr>", desc = "Command History" },
|
||||||
{ "<leader><space>", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
|
{ "<leader><space>", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||||
-- find
|
-- find
|
||||||
{ "<leader>fb", "<cmd>FzfLua buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
{ "<leader>fb", "<cmd>FzfLua buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
||||||
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
|
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
|
||||||
{ "<leader>ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
|
{ "<leader>ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||||
{ "<leader>fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" },
|
{ "<leader>fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" },
|
||||||
{ "<leader>fg", "<cmd>FzfLua git_files<cr>", desc = "Find Files (git-files)" },
|
{ "<leader>fg", "<cmd>FzfLua git_files<cr>", desc = "Find Files (git-files)" },
|
||||||
{ "<leader>fr", "<cmd>FzfLua oldfiles<cr>", desc = "Recent" },
|
{ "<leader>fr", "<cmd>FzfLua oldfiles<cr>", desc = "Recent" },
|
||||||
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
||||||
|
@ -92,12 +92,12 @@ return {
|
|||||||
},
|
},
|
||||||
{ "<leader>/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
{ "<leader>/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" },
|
||||||
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||||
{ "<leader><space>", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
|
{ "<leader><space>", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||||
-- find
|
-- find
|
||||||
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
||||||
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
|
{ "<leader>fc", LazyVim.pick.config_files(), desc = "Find Config File" },
|
||||||
{ "<leader>ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" },
|
{ "<leader>ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" },
|
||||||
{ "<leader>fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" },
|
{ "<leader>fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" },
|
||||||
{ "<leader>fg", "<cmd>Telescope git_files<cr>", desc = "Find Files (git-files)" },
|
{ "<leader>fg", "<cmd>Telescope git_files<cr>", desc = "Find Files (git-files)" },
|
||||||
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
||||||
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
{ "<leader>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,
|
end,
|
||||||
},
|
},
|
||||||
|
@ -57,7 +57,7 @@ function M.open(command, opts)
|
|||||||
return LazyVim.error("LazyVim.pick: picker not set")
|
return LazyVim.error("LazyVim.pick: picker not set")
|
||||||
end
|
end
|
||||||
|
|
||||||
command = command or "auto"
|
command = command ~= "auto" and command or "files"
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
||||||
opts = vim.deepcopy(opts)
|
opts = vim.deepcopy(opts)
|
||||||
@ -71,21 +71,6 @@ function M.open(command, opts)
|
|||||||
opts.cwd = LazyVim.root({ buf = opts.buf })
|
opts.cwd = LazyVim.root({ buf = opts.buf })
|
||||||
end
|
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
|
command = M.picker.commands[command] or command
|
||||||
M.picker.open(command, opts)
|
M.picker.open(command, opts)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user