Skip to content

feature(picker.explorer): filter specific files / folders #1068

Description

@disrupted

Did you check the docs?

  • I have read all the snacks.nvim docs

Is your feature request related to a problem? Please describe.

There are certain paths that I always want to show, such as the hidden .github folder containing CI workflows. However enabling all hidden files and folders can lead to a lot of distracting / irrelevant results for everyday work in a large repository.

Describe the solution you'd like

A way to include / exclude specific paths in the explorer picker. Ideally I would like the option to define a custom filter function similar to how it works for other pickers. I believe this would give the greatest flexibility

Describe alternatives you've considered

I enabled hidden files

picker = { sources = { explorer = { hidden = true } } }

Then I applied a custom filter function similar to other pickers, but I believe it's not implemented for the explorer, e.g.

Snacks.picker.explorer {
    ---@type snacks.picker.filter.Config
    filter = {
        filter = function(item, filter)
            if item.hidden and item.file:match '.github' then
                return true
            end
            if item.hidden then
                return false
            end
            return true
        end,
    },
}

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions