Configure file types that are shown in file explorer
I am using oni with my python projects which generate pyc files which I do not be shown in the file explorer. Is there way to exclude certain file types from being shown?
I checked the documentation and configuration but couldn't find a setting for this.
Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.
There isn't today, but I agree, it would make sense to have this!
A couple different possibilities:
- An explicit setting to ignore files, like
"oni.exclude"(which we have for the quick open today - but it's not respected at the moment) - A setting to respect
.gitignoreand similiar files in the explorer.
@bryphe I agree that an explicit setting similar to what Nerdtree has with NERDTreeIgnore would be awesome. If we could enable on top of that a setting that would take .gitignore as an additional source for excluding files this would be even greater.
What would be the place to start looking at to add this feature?
@bryphe I agree that an explicit setting similar to what Nerdtree has with NERDTreeIgnore would be awesome. If we could enable on top of that a setting that would take .gitignore as an additional source for excluding files this would be even greater.
Sounds great!
What would be the place to start looking at to add this feature?
I think there'd be two possibilities for implementing this - a "pre" and "post" filter strategy. The "pre" filter strategy would prune out the files while we're iterating through the file system - so it could be implemented here: https://github.com/onivim/oni/blob/6bc376beb6c504c1b63115cf916b9d469a73d9a5/browser/src/Services/Explorer/ExplorerStore.ts#L905
Specifically, in this expandDirectoryEpic, we could implement that filter logic.
A "post" filter strategy could be implemented in our 'Selectors'. This would still keep all files in the redux store, but we'd filter them prior to showing in the UI: https://github.com/onivim/oni/blob/6bc376beb6c504c1b63115cf916b9d469a73d9a5/browser/src/Services/Explorer/ExplorerSelectors.ts#L96
We could implement a filter strategy in the flattenFolderTree method potentially.
Hope that helps!