Renaming files Vim-style
I’ve previously written about renaming files with the rename
utility. rename
uses sed-like syntax with regular expressions to rename
files, which are very powerful, but can be a bit tricky to get right.
I recently came across vimv, which is a utility (written in bash) to let you use the full power of Vim to rename files. As a vim user being able to use the same patterns I would use when writing code is very appealing.
It's a great idea, and it turns out that this is also not a new idea. Many other tools have very similar abilities as pointed out by many great replies to the original tweet. Some of tools that offer this ability include (in order of discovery) the aforementioned vimv; three different file managers: ranger, nnn, and vifm; vidir; and qmv, from renameutils (around since 2001!).
We are spoilt for choice! I already use nnn
so I will be making use of it's
"batch rename" feature on my file server. For other cases I think I'll be
reaching for qmv
as it's very mature, and simple to use. Try out one that
works for you.