eza-community / eza

A modern, maintained replacement for ls
https://eza.rocks
MIT License
8.88k stars 170 forks source link

feat: Don't show files listed in '.hidden' file #309

Open sandenbergmelo opened 10 months ago

sandenbergmelo commented 10 months ago

Files listed in the '.hidden' file are not shown by default in file explorers, such as nautilus, unless you enable showing hidden files:

image

But eza always shows these files:

image

It would be nice if eza only showed these files with the -a,--all option enabled.

MartinFillon commented 10 months ago

Do you know you can hide file by putting a dot in front ?

sandenbergmelo commented 10 months ago

Do you know you can hide file by putting a dot in front ?

Yes, I do. But there are many softwares that use files and directories with specific names to save settings. An example of this is ventoy which creates bootable USB drive. It would be nice to have the option for these files not to be shown as well as hidden files with a dot in front. image

cfxegbert commented 10 months ago

Do you know of any documentation showing what expressions can be used in the .hidden file?

sandenbergmelo commented 10 months ago

Do you know of any documentation showing what expressions can be used in the .hidden file?

No. I only use it for simple things with explicit filenames. But I found this. Maybe it will be useful: https://itsfoss.com/hide-files-folders-linux/#bonus-tip-hide-files-and-folders-without-renaming-them-works-in-gui-only-

cfxegbert commented 10 months ago

Found https://gitlab.gnome.org/GNOME/nautilus/-/commit/a03252970245493a3f0e01e470c0a447178f0352#b90b6dc89e587dea53947dc0eeeed48bdc4ebe96_1947_1991

At least in the beginning it was just a filename per line. Don't know about now.

MartinFillon commented 9 months ago

I will have a look and think on how and will we implement it.

CollinDewey commented 9 months ago

For KDE: https://bugs.kde.org/show_bug.cgi?id=246260

9glenda commented 9 months ago

I personally think this should not be on by default. And it should be a flag for enabling it. And if it is on by default there should be a separate flag from -a to just show the hidden files from .hidden

MartinFillon commented 9 months ago

If we decide to implement this as an option we will need to wait for #197 for the moment I will take a look in the code and at how the .hidden file work

9glenda commented 9 months ago

If we decide to implement this as an option we will need to wait for #197 for the moment I will take a look in the code and at how the .hidden file work

Do I get you right that it's a non default option?

MartinFillon commented 9 months ago

yes not a default option and it is to be talked about.

sbatial commented 9 months ago

I think ripgrep respects .ignore as well. I thought that they were what .hidden seems to be.

Does nautilus respect .ignore files?

Do you know of any documentation showing what expressions can be used in the .hidden file?

I figured it would use what .gitignore allows.

kernkraft235 commented 3 months ago

I would like this for macOS for a few reasons:

  1. macOS handles hidden folders differently with chflags. Files starting with a '.' are also hidden. The chflag hidden files show up in the terminal (not hidden)
  2. I can't rename certain files hidden with chflags to have a dot in front
  3. It's harder to enforce XDG-base-dirs, my home folder is so messy when I do eza -a. I'd love to hide them on a deeper level.
  4. There are . folders I care about, but so many more that are just visual noise, but for reasons I cant get rid of them permanently. (this requested feature could be poor-mans ez mode xdg-ninja)
  5. the --git-ignore feature seems to either not work on macOS, or it only works in actual repos (can't use as a plain .ignore). Yes, I did compile it with git support.

Having 2 levels of hidden would be great for organization. You could either extend the difference between -a and -A or make -V "verbose all" where it really shows everything. Or at the very least make it treat +hidden flag as hidden.

MartinFillon commented 3 months ago

Having 2 levels of hidden would be great for organization. You could either extend the difference between -a and -A or make -V "verbose all" where it really shows everything. Or at the very least make it treat +hidden flag as hidden.

so basically -V would be ignore nothing if i understood correctly ?

tartley commented 1 month ago

Apologies for the uninformed drive-by, but the counterpoint would be that having 2 levels of hidden would be great for totally confusing users.

MartinFillon commented 1 month ago

Apologies for the uninformed drive-by, but the counterpoint would be that having 2 levels of hidden would be great for totally confusing users.

You got a really good point here indeed, and btw no need to apology this is an open discussion :smile: