-
-
Notifications
You must be signed in to change notification settings - Fork 622
feat: add api.tree.toggle_enable_filters #2706
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept and change looks good.
Let's get some consistency in user and API naming. Perhaps Toggle All Filters Disabled
and api.tree.toggle_disable_all_filter()
8126caa
to
cccd62f
Compare
What do you think about |
doc/nvim-tree-lua.txt
Outdated
@@ -536,6 +537,7 @@ Following is the default configuration. See |nvim-tree-opts| for details. | |||
show_on_open_dirs = true, | |||
}, | |||
filters = { | |||
disabled = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer enabled = true
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I see that the convention is enable
. Will update PR
...
hijack_directories = {
enable = true,
auto_open = true,
},
update_focused_file = {
enable = false,
update_root = false,
ignore_list = {},
},
system_open = {
cmd = "",
args = {},
},
git = {
enable = true,
show_on_dirs = true,
show_on_open_dirs = true,
disable_for_dirs = {},
timeout = 400,
cygwin_support = false,
},
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works nicely except for the live filter case.
I naturally tried that case when testing and was surprised when it didn't apply. Can we please add that? I imagine users will be similarly surprised.
doc/nvim-tree-lua.txt
Outdated
@@ -1242,6 +1244,11 @@ Only relevant when |modified.show_on_dirs| is `true`. | |||
|
|||
File / folder filters that may be toggled. | |||
|
|||
*nvim-tree.filters.enable* | |||
Enable / disable filters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable / disable filters. | |
Enable / disable all filters including live filter. |
I'm not quite sure about the @gegoune should we change it to something like |
Not overriding existing mappings is a good thing for sure. I see two options:
BTW, |
I'm inclined to agree. Each default mapping added is potentially a user's mapping clobbered. Sorry @DeH4er - please remove the default mapping.
That would break people, however we could add a very trimmed down |
I updated the PR with all your feedback. Since you touched on a topic of keybindings, currently it's hard to get a sense of what's possible.
So I think the ideal solution would be to:
This way, you can have minimal keybinding config and it will be extremely easy to copy-paste api function to your on_attach without reading :h nvim-tree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works beautifully, many thanks!
Hi there. Thanks for the amazing project.
I often find that I need to access hidden files but I keep forgetting keybindings for particular filters. I wish to have one goto keybinding to make it easier to see all files.
I'm unsure about the naming of some vars and functions. But overall, I hope it's a good contribution to the project