Skip to content

Add a binaries field to nvim-tree-opts-filters or nvim-tree-opts-sort #2654

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

Closed
dxrcy opened this issue Jan 29, 2024 · 0 comments · Fixed by #2655
Closed

Add a binaries field to nvim-tree-opts-filters or nvim-tree-opts-sort #2654

dxrcy opened this issue Jan 29, 2024 · 0 comments · Fixed by #2655

Comments

@dxrcy
Copy link
Contributor

dxrcy commented Jan 29, 2024

Can this functionality be implemented utilising API?
No

Is your feature request related to a problem? Please describe.
Binary executables are currently shown in the tree, alongside normal files; however they are unlikely to be useful.
They cannot be hidden with a filename pattern, since they don't have a file extension or other common pattern.

Describe the solution you'd like
I would like to hide binary files, or sort them below other files.
Ideally binary+executable files (such as ELFs) are distinct from other file types such as images.

Describe alternatives you've considered
Filtering with a nvim-tree.filters or nvim-tree.filters.custom

Related to #2648 and similar to #2616

@dxrcy dxrcy changed the title Add a binary field to nvim-tree-opts-filters or nvim-tree-opts-sort Add a binaries field to nvim-tree-opts-filters or nvim-tree-opts-sort Jan 29, 2024
alex-courtis added a commit that referenced this issue Feb 11, 2024
* feat(#2654): add `binaries` field to `filters`

* feat(#2648): allow functions in `filters.custom`

* ci: fix: stylua check

* ci: fix: add new keybind and config to docs

* fix: replace os-specific binary filter with `vim.fn.executable`

* fix: remove function and mapping for `binaries` filter

* fix: add `node` parameter to custom filter function

* fix: update doc for custom filter function signature

* fix: add custom filter to `ACCEPTED_TYPES`

* fix: accept single function for custom filter

* fix: change custom filter on `ACCEPTED_TYPES`

* fix: revert to using `path` for custom filter function

* fix: use `function` type for custom filter

* fix: type for custom filter in help

* fix: custom filter single function no longer mutates `M.config.filter_custom`

* fix: remove dead `if` statement in custom filter

* fix: separate custom filter function from `M.ignore_list`

* doc nit

---------

Co-authored-by: darcy <[email protected]>
Co-authored-by: Alexander Courtis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant