Ⅰ. 插件描述
Rename plugin for neovimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'neoclide/rename-nvim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'neoclide/rename-nvim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'neoclide/rename-nvim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/neoclide/rename.nvim
Ⅳ. 文档说明
# Rename.nvim
Rename variable made easy.
Why?
It's fast and intuitive, while not listen to any of Cursor & TextChange events at all.

Start partial replace by <C-d>.

Start replace in current buffer by <C-a>.

Start project wide replace by mapping to <Plug>(rename-search-replace)
Be sure to check out :h rename-nvim for full features.
Work flow
- Press
<C-a>or<C-d>in normal mode to active. - Optional use
nNoOto navigate. - Optional use
<C-d>to toggle selection. - Change the word.
- Press
<esc>or save/leave buffer or insert none keyword to exit.
Note: You're free to move your cursor after active rename and text change.
Install
This plugin make use of buffer notification feature, you'll have to build your
neovim with PR: neovim/pull/7917
Install nodejs version > 8.0, and run command:
npm install -g neovim
to install neovim node client globally.
Install plugin by plugin manager, like dein.vim by add:
call dein#add('neoclide/rename.nvim', {
\ 'build': 'npm install --only=production'
\})to your init.vim and run:
:call dein#install()in neovim.
When using other plugin manager, you may need to run:
npm install --only=productionin the directory of this plugin and run
:UpdateRemotePluginsin neovim to make remote plugin works.
Trouble shooting
When you find the plugin is not working as expected, run command:checkhealth and make use that output from rename.nvim are OK.
To get the log file, run shell command:
node -e 'console.log(path.join(os.tmpdir(), "rename-nvim.log"))'
LICENSE
MIT