Ⅰ. 插件描述
:performing_arts: Find-N-Replace helper free of regular expressionsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'junegunn/vim-fnr'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'junegunn/vim-fnr'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'junegunn/vim-fnr'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/junegunn/vim-fnr
Ⅳ. 文档说明
vim-fnr
Find-N-Replace in Vim with live preview (experimental)
Installation
Use your favorite plugin manager. vim-fnr requires
vim-pseudocl.
With vim-plug:
Plug 'junegunn/vim-pseudocl'
Plug 'junegunn/vim-fnr'Usage
Normal mode
<Leader>r<Movement>- Substitution in the range
<Leader>R- Substitution of the word under the cursor in the entire document
Visual mode
<Leader>r- Substitution in the selected range
<Leader>R- Substitution of the selected string in the entire document
Command line
:<Range>FNR
The command is repeatable with . key if you have installed
repeat.vim.
Special keys
Tabi- case-insensitive matchw- word-boundary match (\<STRING\>)g- substitute all occurrencesc- confirm each substitutionTaborEnterto return
CTRL-NorCTRL-P- Auto-completion
Options
" Defaults
let g:fnr_flags = 'gc'
let g:fnr_hl_from = 'Todo'
let g:fnr_hl_to = 'IncSearch'Custom mappings
nmap <Leader>r <Plug>(FNR)
xmap <Leader>r <Plug>(FNR)
nmap <Leader>R <Plug>(FNR%)
xmap <Leader>R <Plug>(FNR%)License
MIT