This command line utility lets you batch rename files from the comfort of your favourite text editor. You specify the files to be renamed as arguments, e.g.
$ vimv *.mp3
The list of files will be opened in the editor specified by the
$EDITOR environment variable, one filename per line. Edit the list, save, and exit. The files will be renamed to the edited filenames.
vimv --help to view the command line help:
Usage: vimv [FLAGS] [OPTIONS] [ARGUMENTS] This utility lets you batch rename files using a text editor. Files to be renamed should be supplied as a list of command-line arguments, e.g. $ vimv *.mp3 The list of files will be opened in the editor specified by the $EDITOR environment variable, one filename per line. Edit the list, save, and exit. The files will be renamed to the edited filenames. Directories along the path will be created as required. Use the --force flag to overwrite existing files. Existing directories will not be overwritten. (If you attempt to overwrite a directory the program will exit with an error message and a non-zero status code.) Arguments: [files] List of files to rename. Options: -e, --editor <name> Specify the editor to use. Flags: -f, --force Force overwrite existing files. -h, --help Print this help text. -v, --version Print the version number.
Vimv is written in Rust — if you have a Rust compiler available you can install it directly from the package index using
$ cargo install vimv
You can find the source files on Github.
If you want to use a graphical editor like VS Code or Sublime Text instead of a terminal editor like Vim then (depending on your operating system) you may need to add a 'wait' flag to the
$EDITOR variable to force the editor to block, e.g.
EDITOR="code -w" # for VS Code EDITOR="subl -w" # for Sublime Text EDITOR="atom -w" # for Atom
The same flag can be used with the
--editor option, e.g.
$ vimv *.mp3 --editor "code -w"