Ⅰ. 插件描述
The vim textobject plugin to treat function-call regions.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'machakann/vim-textobj-functioncall'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'machakann/vim-textobj-functioncall'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'machakann/vim-textobj-functioncall'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/machakann/vim-textobj-functioncall
Ⅳ. 文档说明
vim-textobj-functioncall
The vim textobject plugin to treat function-call regions.
Default mappings are assigned to if and af.
ifandaf, both of them select a region likefunc(argument).ifandafbehave differently when a function takes another function as its argument.ifselects the most inner function under the cursor.afselects the first function including the cursor position by its parenthesis. However if any candidate would be found, it falls back toif.
# : cursor position
call func1(func2(argument))
|<-----if---->|
call func1(func2(argument))
|<--------af-------->|If you don't like to map to if and af, please define the variable named g:textobj_functioncall_no_default_key_mappings in your vimrc.
let g:textobj_functioncall_no_default_key_mappings = 1And then map to your preferable keys.
xmap iF <Plug>(textobj-functioncall-i)
omap iF <Plug>(textobj-functioncall-i)
xmap aF <Plug>(textobj-functioncall-a)
omap aF <Plug>(textobj-functioncall-a)This textobject could select following patterns.
func(argument)array[index]