Skip to content

FEATURE: can always_show by pattern #1255

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
1 task done
jcarstairs-scottlogic opened this issue Dec 6, 2023 · 5 comments
Closed
1 task done

FEATURE: can always_show by pattern #1255

jcarstairs-scottlogic opened this issue Dec 6, 2023 · 5 comments
Labels
enhancement New feature or request good-first-issue help wanted Extra attention is needed

Comments

@jcarstairs-scottlogic
Copy link

Did you check the docs?

  • I have read all the docs.

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

I want to be able to always show environment files, since I often want to edit these, but they're also commonly listed in a .gitignore, so they are often hidden by Neotree. Environment files generally follow a simple pattern: .env*. But right now, I can only list possible literal environment file names one by one.

Describe the solution you'd like.

The always_show property should accept glob patterns, the same as the hide_by property.

To me, it looks like this means there should be a function call something like utils.is_filtered_by_pattern(f.always_show, path, name) when file items get created. Compare how the hide_by property is handled.

Describe alternatives you've considered.

I could just list environment file names. But that's going to get annoying quickly. Realistically, I'll never bother.

Additional Context

No response

@jcarstairs-scottlogic jcarstairs-scottlogic added the enhancement New feature or request label Dec 6, 2023
@cseickel
Copy link
Contributor

cseickel commented Dec 9, 2023

That seems perfectly reasonable. If you or anyone else wants to put up a PR for an always_show_by_pattern config I will accept it.

@PumpedSardines
Copy link
Contributor

I made a PR for this feature request since i needed it myself

@dpetka2001
Copy link

Does the PR that was made actually work? I tried always_show_by_pattern = { ".git*" } and it doesn't always show the directories .git, .github and the file .gitignore by default. Setting always_show = { ".git", ".github", ".gitignore" } does work as intended. Am I doing something wrong when using always_show_by_pattern?

@PumpedSardines
Copy link
Contributor

PumpedSardines commented Jun 30, 2024

@dpetka2001 just tried adding always_show_by_pattern = { ".git*" } to my config and it works on my setup. I see all folders and files starting in .git. Are you sure you're using the right version of neo-tree?

Screenshot showing my default view with always_show_by_pattern = { ".git*" }
image

EDIT:
Im using nix to handle my plugins, so maybe you get a different version when downloading this plugin using lazy.nvim? It doesn't seem like my commit has been included in a release yet

@dpetka2001
Copy link

Yes, I had branch = "v3.x". Removed that and was able to update to latest HEAD. Thanks for the heads up. Now it works as it should 😄

@pynappo pynappo closed this as completed Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good-first-issue help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants