Replies: 2 comments
-
Another thing that needs to be considered, is that one item may be caught by multiple filters with different settings. For example, given a folder called: require("neo-tree").setup({
filesystem = {
filtered_items = {
dotfiles = "hidden", -- or "marked", or "skip". "never show" probably wouldn't make sense
gitignored = "marked", -- or "hidden", or "skip". "never show" probably wouldn't make sense
exclude_by_name = {
[".target"] = "never show",
[".DS_Store"] = "never show", -- or "hidden" or "marked"
["thumbs.db"] = "never show", -- or "hidden" or "marked"
["node_modules"] = "marked" -- or "hidden", "never show" probably wouldn't make sense for this one
},
}
}
}) If
So, does the most agressive "never show" override the others, or does the least aggressive "marked" take precedence? Or maybe it goes by strategy and Maybe there are too many variations and I should remove the four way value choice? If I go back to true/false and add one more category for require("neo-tree").setup({
filesystem = {
filtered_items = {
default_view = "hidden", -- or "marked". This applies to all means of identifying a hidden file.
dotfiles = true,
gitignored = true,
hide_by_name = {
"node_modules"
},
never_show = {
".target",
".DS_Store",
"thumbs.db"
},
}
}
}) and in that case, require("neo-tree").setup({
filesystem = {
filtered_items = {
default_view = "hidden", -- or "marked". This applies to all means of identifying a hidden file.
dotfiles = true,
gitignored = true,
hide_by_name = {
"node_modules"
},
never_show = {
".DS_Store",
"thumbs.db"
},
}
}
}) then Sorry for the long winded posts, but the more I think about it the more complicated it gets. |
Beta Was this translation helpful? Give feedback.
-
link my idea on the one of the related thread: #149 (comment) |
Beta Was this translation helpful? Give feedback.
-
This is triggered by the work I am doing on #149 and #148, which I am doing together because they are interrelated. As I try to expand on those config options, I realize that it is just confusing because I started out just passing through the options of a Pleanry scan_dir function that no longer really matches what we need.
Here is what I have right now, including the unreleased work in progress of #149 and #148. I don't actually like it:
Cleanup Current Option Names
To start off with, is the label
filters
even the best choice? Maybe it should be calledhidden
orfiltered_items
?Next,
show_hidden
is not quite accurate because it really refers to the *nix concept of hidden, which is to hide dotfiles (starting with a .). I think these should be renamed todotfiles
, which also reverses the meaning of boolean value to line up with the gitignore one. I would also changerespect_gitignore
to justgitignored
, so instead of:we have:
which is the same result as what we have for those settings in the top example but I think the meaning is clearer.
Additional Options for Exclude and Show Hidden
I want to discuss these at the same time because those additional options could affect the design of the entire section. To specify specific folders/files to exclude by name, I am proposing either:
...or maybe the
show_hidden
option can be mixed into the individual items. In the example below, I've added a third state, which is"never show"
, the meaning of the settings are:hidden
= Hide by default, but allow you to toggle the hidden state and show it with a different highlight group or symbolmarked
= Always show, but with a different highlight group or symbolnever show
= Always hide it, even if you toggle showing other hidden items, this one will never be shownEDIT: There really needs to be a fourth item that corresponds to
false
:"never hide"
Toggle Commands
Since I brought up the subject of toggling hidden items above, I also want to mention that I find it annoying it toggle dotfiles and gitgnored with separate commands. Now that we are adding another group for "excluded" items, I think we need to drop the separate commands and just have one single
toggle_all_hidden
command which will show/hide allfiltered_items
at once.Please let me know what you think and if anyone has any other ideas on this subject.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions