Protesilaos Stavrou has a new video up about his customizations of dired. Dired is one of those things that you either love or ignore. Even I, a hardcore command line guy, use dired for the majority of my file operations. It’s just easier and faster, especially if you want to perform an operation on multiple files at once. And, of course, you don’t have to leave Emacs.
Stavrou, as always, has his own tweaks to make his workflow even more frictionless. One of the things he likes to do is filter the dired listing so that he sees only the files he’s interested in. That’s not hard to do. The normal procedure is to mark the files you want to see, toggle the markings (with t) so that all the other files are marked instead, and kill the marked files from the listing. It’s easy but it’s a three-step process. Stavrou wrote a simple function that performs those three functions so that all he has to do is specify a regular expression for the files he wants to see to get the proper listing. If you filter your dired listings a lot, it’s a worthwhile addition to your toolkit.
His other big tweak is to the subdirectory display functionality. Again, dired supports this out of the box but Stavrou has streamlined the operations. His system is much more interactive and makes applying changes to some subset of a subdirectory easy.
The video is just a few seconds over 23 minutes so you’ll need to schedule some time but it’s not a huge commitment. As with all of Prot’s videos, this is very much worth your while and he includes a link to his configuration so that you can grab his code if you’d like.