Hidden files were a mistake to start with and continue to be a misfeature. Most people searching for a filename won't care if it's hidden or not, and having to remember to add --hidden to almost every search isn't a good use of time, and leads to confusion when you forget to do so.
There are other things too about the dotfiles problem.
But until a usable solution will be created, I think, the current setup of fd is better than the proposed.
If you want ~hidden files~ dotfiles by default, you should add an alias to your shell.
I think, a much better solution for default options is an environment variable (similar to the FZF_DEFAULT_OPTS variable of fzf).
Please see #18 and #179 for related discussions.
Most people searching for a filename won't care if it's hidden or not
I care about it when my pattern is very broad - or even non-existent. I frequently use fd without any argument to get an overview of a directory.
Also, I mostly don't care about search results in hidden folders (e.g. .git folders) or concerning hidden files. Looking through my home directory, I see files like: .i3pystatus-13213, .goutputstream-CA795Y, .v8flags.5.0.71.57.shark.json, .zcompdump-floyd-5.3, etc.
Notice that tools like rg, ag, ls and shell globs all ignore hidden files by default.
If you want hidden files dotfiles by default, you should add an alias to your shell.
Yes.
I think, a much better solution for default options is an environment variable (similar to the FZF_DEFAULT_OPTS variable of fzf).
Interesting idea. Is this something that other tools provide as well?
Interesting idea. Is this something that other tools provide as well?
Do you mean configuring with environment variables?
For example, take a look at the ENVIRONMENT VARIABLES section in the exa man page.
By the way, I think, fd should support some code from the EXA_COLORS variable: #222
Do you mean configuring with environment variables?
I meant ***_DEFAULT_OPTS environment variable, in particular. I was wondering if this was standard practice - haven't seen this before. Doesn't seem like it.
Also, I mostly don't care about search results in hidden folders (e.g. .git folders) or concerning hidden files.
I would be totally fine with ignoring the .git directory when --no-ignore is not set, that seems consistent to me.
Also, I mostly don't care about search results in hidden folders (e.g. .git folders) or concerning hidden files. Looking through my home directory, I see files like:
.i3pystatus-13213,.goutputstream-CA795Y,.v8flags.5.0.71.57.shark.json,.zcompdump-floyd-5.3, etc.
I completely agree with this, and the way programs spray around files like that is a huge problem. I also don't like false positives where junk files get returned in a search.
Unfortunately false negatives are worse. When I'm searching for a file that matches a specific pattern my default is not to care if it's a dotfile or not, especially since dotfiles are often used to control program behavior and so are exactly the kind of thing I'm looking for. The annoyance of seeing junk files is bad, but confusion is worse.
Please see #18 and #179 for related discussions.
Sorry I missed those. I'll bow out of this discussion now, feel free to close this once you've discussed it to your satisfaction.
Interesting idea. Is this something that other tools provide as well?
less has the LESS environment variable
grep has the GREP_OPTIONS environment variable
I'm going to close this, as I still think it's straightforward to define
alias fd="fd --hidden --exclude '.git'"
if someone wants to see hidden files by default (but ignore .git folders, for example).
I'm not too excited about using environment variables as I would like fd to be a tool that can potentially be used in scripts where the default behavior should not be influenced by environment variables.
Most helpful comment
Please see #18 and #179 for related discussions.
I care about it when my pattern is very broad - or even non-existent. I frequently use
fdwithout any argument to get an overview of a directory.Also, I mostly don't care about search results in hidden folders (e.g.
.gitfolders) or concerning hidden files. Looking through my home directory, I see files like:.i3pystatus-13213,.goutputstream-CA795Y,.v8flags.5.0.71.57.shark.json,.zcompdump-floyd-5.3, etc.Notice that tools like
rg,ag,lsand shell globs all ignore hidden files by default.Yes.
Interesting idea. Is this something that other tools provide as well?