3 ms·
I wrote this to make renaming multiple files quicker/easier: https://github.com/ivanmaeder/vimv https://github.com/ivanmaeder/vimv Basically it loads up the o
by ivanmaeder 7y ago
I wrote this to make renaming multiple files quicker/easier:
https://github.com/ivanmaeder/vimv https://github.com/ivanmaeder/vimv
Basically it loads up the output of `ls` into an editor, then runs a `mv` command for each line.
Not something I use daily, but still handy.
- gaving 7y agoPretty cool with the editor interaction. Also worth bearing in mind most shells can do this sort of thing easily enough too. The example from your video with zsh's zmv (bundled: https://github.com/zsh-users/zsh/blob/master/Functions/Misc/zmv https://github.com/zsh-users/zsh/blob/master/Functions/Misc/... ) > touch btn_google_{signin,signup}_dark_normal_web{,@2x}.png # create files > ls -l .rw-r--r-- 0 gaving 31 Dec 10:34 btn_google_signin_dark_normal_web.png .rw-r--r-- 0 gaving 31 Dec 10:34 btn_google_signin_dark_normal_web@2x.png .rw-r--r-- 0 gaving 31 Dec 10:34 btn_google_signup_dark_normal_web.png .rw-r--r-- 0 gaving 31 Dec 10:34 btn_google_signup_dark_normal_web@2x.png > zmv -n -W btn_*_sign*_dark_normal_web* *_sign_** # dry run mv -- btn_google_signin_dark_normal_web.png google_sign_in.png mv -- btn_google_signin_dark_normal_web@2x.png google_sign_in@2x.png mv -- btn_google_signup_dark_normal_web.png google_sign_up.png mv -- btn_google_signup_dark_normal_web@2x.png google_sign_up@2x.png > zmv -W btn_*_sign*_dark_normal_web* *_sign_** # change files > ls -l .rw-r--r-- 0 gaving 31 Dec 10:34 google_sign_in.png .rw-r--r-- 0 gaving 31 Dec 10:34 google_sign_in@2x.png .rw-r--r-- 0 gaving 31 Dec 10:34 google_sign_up.png .rw-r--r-- 0 gaving 31 Dec 10:34 google_sign_up@2x.png
- pheug 7y agoThere's vidir in debian's moreutils package which does pretty much exactly that. Check all also all the other tools from that package: https://manpages.debian.org/buster/moreutils/index.html https://manpages.debian.org/buster/moreutils/index.html The package's tagline is "collection of the Unix tools that nobody thought to write long ago, when Unix was young", so pretty relevant to the whole topic.
- ivanmaeder 7y agoThis is cool! Thanks for this, I had no idea it existed. It looks like the functionality is almost identical. Even the command names are similar…
- globular-toast 7y agoEmacs has something built in just like that called dired (directory edit). Shows you ls-like output, you edit it like a text file then save it. It means you can use all your familiar text editing tools to do what you need to do.