Ⅰ. 插件描述
Batch-rename files using VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'thameera/vimv'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'thameera/vimv'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'thameera/vimv'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/thameera/vimv
Ⅳ. 文档说明
# vimv
vimv is a terminal-based file rename utility that lets you easily mass-rename files using Vim.
Installing
curl https://raw.githubusercontent.com/thameera/vimv/master/vimv > ~/bin/vimv && chmod +755 ~/bin/vimvOr simply copy the vimv file to a location in your $PATH and make it executable.
Usage
- Go to a directory and enter
vimvwith optionally, a list of files to rename. - A Vim window will be opened with names of all files.
- Use Vim's text editing features to edit the names of files. For example, search and replace a particular string, or use visual selection to delete a block.
- Save and exit. Your files should be renamed now.
Other features
- If you want to list only a group of files, you can pass them as an argument. eg:
vimv *.mp4 - If you have an
$EDITORenvironment variable set, vimv will use its value by default. - If you are inside a Git directory, vimv will use
git mv(instead ofmv) to rename the files. - You can use
/some/path/filenameformat to move the file elsewhere during renaming. If the path is non-existent, it will be automatically created before moving.
Screencast

Gotchas
Don't delete or swap the lines while in Vim or things will get ugly.