diff --git a/nvim/.config/nvim/lua/lazy-plugins/collection-snacks-nvim.lua b/nvim/.config/nvim/lua/lazy-plugins/collection-snacks-nvim.lua index 1ccf6c3..aa8b784 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/collection-snacks-nvim.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/collection-snacks-nvim.lua @@ -75,6 +75,29 @@ return { end, desc = "Grep", }, + { + "\\", + function() + -- Get a list of all directories in the workspace + local workspace_path = vim.fn.getcwd() + local directories = vim.fn.systemlist("find " .. workspace_path .. " -type d") + + -- Present the directories to the user for selection + vim.ui.select(directories, { + prompt = "Select a directory:", + format_item = function(item) + return item + end, + }, function(choice) + if choice then + Snacks.picker.grep({ dirs = { choice } }) + else + print("No directory selected") + end + end) + end, + desc = "Grep", + }, { ":", function()