Search & open files in a specific set of directories recursively using mini.pick #1369
-
I'm trying to figure out a way to open/search files in a specific set of directories recursively. For example, C:\Program Files\Double Commander\doc , C:\Users\Anthony\Documents\01.20.SC.DOTS\01.23.SC.AUTH C:\Users\Anthony\Downloads\12.40.SC.LIT\12.43.LTST keymap("n", "fr", function() require("mini.extra").pickers.oldfiles() end, { noremap = true, silent = true, desc = 'Find RECENT File' }) I would prefer to easily/simply add to the set of directories using a bookmarks file. BTW. I'm using ONLY mini.nvim plugins and I'm loving it. I like the idea of using one set of ideas/philosophy to learn neovim (...and little lua for that matter). I can say that I have certainly cured plugin hopping and information overload trying to understand how different plugin works. This has definitely sped up my learning curve. THANKS A LOT for your great work @echasnovski . |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thanks for kind words!
Yes, it is possible. All built-in pickers can be given a If you plan to do it frequently and interactively, here is an example of how to modify built-in
That would be a bit tricky if you want to interactively modify those bookmarks. Otherwise it can be done by having a single list of bookmarks and a picker with MiniPick.registry.bookmark_dirs = function()
-- Modify list as you want. Prefer full paths (see `:h fnamemodify()` maybe).
local dirs = {
'~/.config/nvim',
'~/.local'
}
local choose = function(item)
vim.schedule(function() MiniPick.builtin.files(nil, { source = { cwd = item } }) end)
end
return MiniPick.start({ source = { items = dirs, name = 'Bookmark dirs', choose = choose } })
end Now you can do something like And I'd strongly recommend using |
Beta Was this translation helpful? Give feedback.
Thanks for kind words!
Yes, it is possible. All built-in pickers can be given a
source.cwd
("current working directory") as a field of itsopts
argument.If you plan to do it frequently and interactively, here is an example of how to modify built-in
files
registry entry to acceptcwd
. With this you can do something like:Pick files cwd='C:\\Program\ Files\\...'
(not escaping of\
and spaces).