Overview
Currently, fd can filter hidden/ignored files from search results according to the following flags:
--ignore, --no-ignore, --no-ignore-vcs: Show/omit search results from files and directories ignored by rules/patterns in '.gitignore', '.ignore', '.fdignore', or the global ignore files.
--hidden, --no-hidden: Show/omit search results from hidden dot files.
--unrestricted: Show both the ignored and hidden files.
This gives us two kinds of results:
- A "restricted" mode with the paths matched by the search patterns but without the files/folders in hidden/ignored paths.
- A "mixed" mode with all the paths matched by the search patterns, disregarding when it is or isnt't in a hidden/ignored path.
Proposal
- Add a new flag like
--only-restricted to filter out files/folders that are not under ignore/hidden paths.
- This will yield a third mode where the search result will omit "restricted" entries but will show files/folders that are under ignore/hidden paths.
- This new flag can also be combined with flags
--no-ignore and --hidden to further restrict the search results.
Use cases
- Searching only in hidden folders like
$XDG_CONFIG_HOME ($HOME/.config/)
- Searching only non-committed files under
.gitignore rules in Git repositories
Overview
Currently,
fdcan filter hidden/ignored files from search results according to the following flags:--ignore,--no-ignore,--no-ignore-vcs: Show/omit search results from files and directories ignored by rules/patterns in '.gitignore', '.ignore', '.fdignore', or the global ignore files.--hidden,--no-hidden: Show/omit search results from hidden dot files.--unrestricted: Show both the ignored and hidden files.This gives us two kinds of results:
Proposal
--only-restrictedto filter out files/folders that are not under ignore/hidden paths.--no-ignoreand--hiddento further restrict the search results.Use cases
$XDG_CONFIG_HOME($HOME/.config/).gitignorerules in Git repositories