kickingvegas / casual

A collection of opinionated keyboard-driven user interfaces for various built-in Emacs modes.
GNU General Public License v3.0
11 stars 2 forks source link

Toggle to show hidden files and directories #37

Open rien333 opened 5 months ago

rien333 commented 5 months ago

I sometimes need to perform actions on hidden files/directories, but often can't because I don't remember how to show them in dired. I think one could show them by modifying the switches in dired-listing-switches , but I tend to think "well, finding the name of the right variable, adding the switch, and then finally removing it again takes me more time than to open a terminal".

Hence, adding a "show hidden files" option in the transient menu would benefit a dired noob like me. A good keybinding might be . (because on Unix, hidden files start with a .). I think having a checkbox next to it (like the Hide Details option) might be a good idea.

kickingvegas commented 5 months ago

@rien333 Thanks much for sharing this.

TL;DR: I’ll think about it.

A couple of observations:

A perfect solution would entail covering a dizzying number of corner cases. Little wonder that the Dired maintainers have avoided building this feature in the first place.

There is the notion of building a “good enough” solution. My concern is that an imperfect solution will cascade into future issues raising the corner cases not covered. I would rather not put myself in a situation where I can’t fix it.

I’ll leave this issue open to size what a solution would be for it. If the scope and risk are too large I’ll punt.

Another thing is to revisit the design of the Sort By menu, which upon reflection doesn’t abstract away enough of the ls command line switches.

Screenshot link: https://github.com/kickingvegas/casual-dired/blob/main/docs/images/casual-dired-sort-by-screenshot.png

For example instead of using the label “all”, it’s probably better to use “Show all (including dot files)”.

kickingvegas commented 5 months ago

@rien333 fyi, just released v1.1.0 with an updated Sort By menu. Here's a screenshot.

https://github.com/kickingvegas/casual-dired/blob/9f65992e362c65a3023e4e2bc4853df9e92fa2d4/docs/images/casual-dired-sort-by-screenshot.png

rien333 commented 5 months ago

Thanks for the active effort so far, gonna try it in a bit!