feat(pick): move pickers to extras telescope & fzf-lua and include telescope by default

This commit is contained in:
Folke Lemaitre 2024-06-12 14:01:31 +02:00
parent 4b9e4edbb1
commit b2b6ff0738
7 changed files with 309 additions and 266 deletions

View file

@ -1,18 +1,25 @@
---@class FzfLuaOpts: lazyvim.util.pick.Opts
---@field cmd string?
LazyVim.pick.commands = {
files = "files",
}
---@type LazyPicker
local picker = {
name = "fzf",
commands = {
files = "files",
},
---@param command string
---@param opts? FzfLuaOpts
LazyVim.pick._open = function(command, opts)
opts = opts or {}
if opts.cmd == nil and command == "git_files" and opts.show_untracked then
opts.cmd = "git ls-files --exclude-standard --cached --others"
end
return require("fzf-lua")[command](opts)
---@param command string
---@param opts? FzfLuaOpts
open = function(command, opts)
opts = opts or {}
if opts.cmd == nil and command == "git_files" and opts.show_untracked then
opts.cmd = "git ls-files --exclude-standard --cached --others"
end
return require("fzf-lua")[command](opts)
end,
}
if not LazyVim.pick.register(picker) then
return {}
end
local function symbols_filter(entry, ctx)
@ -26,11 +33,8 @@ local function symbols_filter(entry, ctx)
end
return {
{ "stevearc/dressing.nvim", enabled = false },
{
"nvim-telescope/telescope.nvim",
enabled = false,
},
desc = "Awesome picker for FZF (alternative to Telescope)",
recommended = true,
{
"ibhagwan/fzf-lua",
event = "VeryLazy",