vim-fnr


Ⅰ. 插件描述

:performing_arts: Find-N-Replace helper free of regular expressions

Ⅱ. 基本信息

创建日期:  2014-01-04
使用用户:  41
Github星:  24
插件作者:  Junegunn Choi

Ⅲ. 安装方法

使用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

  • Tab

    • i - case-insensitive match
    • w - word-boundary match (\<STRING\>)
    • g - substitute all occurrences
    • c - confirm each substitution
    • Tab or Enter to return
  • CTRL-N or CTRL-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

添加新评论