find/search directories only #1962
-
Hi, currently I'm using find_command = { "fd", "--type", "directory", "--follow", "--hidden" } For the new setup I tried to use Snacks.picker.files({
hidden = true,
follow = true,
cmd = "fd",
args = { "--type", "d" },
}) but it also lists files, not directories exclusively. Any help is appreciated. |
Beta Was this translation helpful? Give feedback.
Answered by
drowning-cat
Jun 11, 2025
Replies: 1 comment 2 replies
-
The simplest solution to your problem: Snacks.picker.files {
hidden = true,
follow = true,
cmd = 'fd',
args = { '--type', 'd' },
transform = function(item)
return vim.fn.isdirectory(item.file) == 1
end,
} |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
frankebel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The simplest solution to your problem: