Ⅰ. 插件描述
vim operator to :Ag the motioned textⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'tek/vim-operator-ag'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'tek/vim-operator-ag'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'tek/vim-operator-ag'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/tek/vim-operator-ag
Ⅳ. 文档说明
vim-operator-ag
Usage
map {lhs} <Plug>(operator-agg)
Executing the {lhs} command followed by a motion like iW will ag the current directory for the text selected by the motion.
map {lhs} <Plug>(operator-ag)
This variant leaves vim in command-line mode, allowing you to specify a search path or additional ag parameters.
Customization
g:operator_ag_cmd = 'Ag!'
The command to be executed.
g:operator_ag_escape = 1
Whether or not the selected text should be shellescaped.
This is necessary for :Ag, as its arguments are being passed to the shell as-is.
When using a different approach, e.g. via Unite, set this to 0.