-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature(picker.sources): add lazy plugin spec #680
Comments
Just do |
You could also use something of a keymap like the following {
"<leader>fl",
function()
local dirs = {
vim.fn.stdpath("config") .. "/lua/plugins", -- user specs
vim.fn.stdpath("data") .. "/lazy/LazyVim/lua/lazyvim/plugins", -- LazyVim specs
}
---@diagnostic disable-next-line: missing-fields
Snacks.picker.files({
finder = function()
local items = {}
for _, item in ipairs(dirs) do
items[#items + 1] = {
file = item,
text = item,
}
end
return items
end,
format = "text",
actions = {
confirm = function(_, item)
Snacks.picker.pick("grep", {
cwd = item.file,
search = "/.*",
live = true,
on_show = function()
vim.schedule(function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("i", true, false, true), "n", false)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<right>", true, false, true), "n", false)
end)
end,
})
end,
},
})
end,
desc = "Find Lazy Plugin Spec",
}, That way in the initial picker you choose if you want to search User or LazyVim specs and when you choose a directory another grep picker launches where you can search with the appropriate pattern for the plugin you want. |
Thanks, it helps. However, spec could also be name only like: Sorry, I didn't make myself clear. About distinguishes between LazyVim and User Specs, I think it would be better to list them all, but label them in some way, like |
Then you just adjust your pattern to not include the character For the second part of your comment, you could maybe use the |
Did you check the docs?
Is your feature request related to a problem? Please describe.
I split the plugin specs in multiple files as suggested by lazy.nvim doc. So I need to remember the spec position or search for "/plugin_name" to look over when needed.
Some cases:
/snacks
, URLs likehttps://github.com/folke/snacks.nvim/pull/136#issuecomment-2492044614
in my config also come up./nvim-treesitter
instead of/treesitter
."nvim-treesitter"
, which is hard to search.Describe the solution you'd like
Before I migrate away from telescope, I enjoy polirritmico/telescope-lazy-plugins.nvim.
Screen Shot:
It shows both LazyVim and User Specs (but does not distinguish between them).
I wish snacks picker adds a source for lazy plugin spec like telescope-lazy-plugins.nvim. Please distinguishes between LazyVim and User Specs if you do this. Something like
editor/snacks_picker (lazyvim)
andplugins/ui (user)
.Describe alternatives you've considered
Search for
/plugin_name
.Additional context
Thank you for your continued contribution. Enjoy your works so much. Please feel free to close this issue.
The text was updated successfully, but these errors were encountered: