> For file management these days, Dired is my interface of choice. It is simply the more elegant tool for the job. Case in point: renaming a bunch of files in a directory to arbitrary names. With a shell, my standard approach would have been to run some variant of `ls -1 > foo.sh`, edit `foo.sh` to insert `mv` on each line to a renamed target file, `chmod u+x foo.sh` to be executable, run `foo.sh`, delete `foo.sh` and call it a day.
I used to do this before I discovered vidir. [1]
vidir is not actually tied to vi; it lets you rename and delete files through your `$EDITOR`.
You edit a temporary file that looks like this:
Emacs Rocks Episode 13 is a wonderful example of how Emacs utilities quickly compound over time. It's worth checking out its editable dired buffer example (with multiple cursors) but also stick around for the ending. Great finale.
Shout out to moreutils, there are many nice utilities, and there's a `moreutils` package in most distributions.
Update: Looking at the authors listed in the man pages, the `trapd00r` version looks to be a fork of the moreutils version. Not sure how the functionality compares. Both versions seem to have been updated since the fork.
> Both versions seem to have been updated since the fork.
Thanks for pointing this out.
It looks like the @trapd00r version has added `--sort` but lacks zero padding for the numbers that improves the UX.
I mistakenly thought it was a fork tracking the original.
I have edited my comment.
I used to do this before I discovered vidir. [1] vidir is not actually tied to vi; it lets you rename and delete files through your `$EDITOR`. You edit a temporary file that looks like this:
There is also https://github.com/bulletmark/edir designed to improve on vidir. I haven't used it yet.I'll give Emacs another try some day, I swear, and Dired is one of the reasons.
Edit: [1] I linked to https://github.com/trapd00r/vidir here at first. That is a fork; vidir comes from https://joeyh.name/code/moreutils/. You probably want the original. It is packaged for Debian, FreeBSD, Homebrew, etc. as part of the package `moreutils`.