Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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:

  ...
  0093<tab>./fstab
  0094<tab>./fuse.conf
  0095<tab>./fwupd
  ...
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`.



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.


Is <https://github.com/trapd00r/vidir> the same as `vidir` from <https://joeyh.name/code/moreutils/>?

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 didn't know of vidir, but I just thought I'd share some funny etymology, since I know someone called Viðir.

Besides meaning vi + dir, the Icelandic name means "willow tree", which is a cool name for a directory traversal tool.


There is a code witch named Vidrun (https://aphyr.com/posts/341-hexing-the-technical-interview), presumably with similar roots.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: