mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 17:58:51 +02:00
feat(pick): move pickers to extras (telescope still the default) (#3606)
## What is this PR for? Refactoring of pickers in LazyVim: - [x] telescope moved to extras - [x] dressing was moved to the telescope extra. Not needed with fzf-lua and noice - [x] when none of the two is enabled, then telescope will be enabled - [x] when using `:LazyExtras` to enable fzf-lua, the telescope spec will never be parsed - [x] when not using `:LazyExras`, the spec will be parsed, but one of the two will be disabled. - [x] only one picker extra can be used to prevent issues - [ ] cleanup lsp keymaps
This commit is contained in:
parent
d82c11f889
commit
39a908c9fa
10 changed files with 331 additions and 284 deletions
|
@ -1,20 +1,20 @@
|
|||
local pick = function()
|
||||
if pcall(require, "telescope") then
|
||||
if LazyVim.pick.picker.name == "telescope" then
|
||||
return vim.cmd("Telescope projects")
|
||||
end
|
||||
|
||||
local fzf_lua = require("fzf-lua")
|
||||
local history = require("project_nvim.utils.history")
|
||||
local results = history.get_recent_projects()
|
||||
fzf_lua.fzf_exec(results, {
|
||||
actions = {
|
||||
["default"] = {
|
||||
function(selected)
|
||||
fzf_lua.files({ cwd = selected[1] })
|
||||
end,
|
||||
elseif LazyVim.pick.picker.name == "fzf" then
|
||||
local fzf_lua = require("fzf-lua")
|
||||
local history = require("project_nvim.utils.history")
|
||||
local results = history.get_recent_projects()
|
||||
fzf_lua.fzf_exec(results, {
|
||||
actions = {
|
||||
["default"] = {
|
||||
function(selected)
|
||||
fzf_lua.files({ cwd = selected[1] })
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue