Ⅰ. 插件描述
Find And Replace Vim pluginⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'brooth/far-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'brooth/far-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'brooth/far-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/brooth/far.vim
Ⅳ. 文档说明
# far.vim - Find And Replace Vim plugin
Intro
Far.vim makes it easier to find and replace text through multiple files.
It's inspired by fancy IDEs, like IntelliJ and Eclipse, that provide
cozy tools for such tasks.
Installation
vim-plug
Plug 'brooth/far.vim'Usage
Searching with Command
:Far foo bar **/*.py
:Fardo
:Far {pattern} {replace-with} {file-mask} [params]
Find the text to replace.
:F {pattern} {file-mask} [params]
Find only.
Searching Interatively
:Farr foo bar **/*.py
:Farr [params]
Interative Far. Shows searching modes in the status bar (regex, case sensitive, word boundary, replace). Modes can be toggled by the key mapping it prompted. Allows to enter {pattern}, {replace-with} and {file-mask} one after the other.
:Farf [params]
Interative F. The interaction is similar to Farr.
Commands in the searching result window
:Fardo [params]
Runs the replacement task. The shortcut for it is s (substitute).
:Farundo [params]
Undo the recurrent replacement. The shortcut for it is u (undo). It is available when set let g:far#enable_undo=1.
:Refar [params]
Change Far/F/Farr/Farf params.
Need help?
:help far.vimExtras
Multiline Replacement

Neovim-Async, Ack, Ag, Ripgrep support

Command-Line Completion

Consistency Check

..and many more! Check out :help far.vim.
Troubleshooting
Recommented Setting
You can add he following settings to your vim configuration:
set lazyredraw " improve scrolling performance when navigating through large results
set regexpengine=1 " use old regexp engine
set ignorecase smartcase " ignore case only when the pattern contains no capital letters
" shortcut for far.vim find
nnoremap <silent> <Find-Shortcut> :Farf<cr>
vnoremap <silent> <Find-Shortcut> :Farf<cr>
" shortcut for far.vim replace
nnoremap <silent> <Replace-Shortcut> :Farr<cr>
vnoremap <silent> <Replace-Shortcut> :Farr<cr>License
MIT