vim-textobj-functioncall


Ⅰ. 插件描述

The vim textobject plugin to treat function-call regions.

Ⅱ. 基本信息

创建日期:  2014-04-13
使用用户:  3
Github星:  9
插件作者:  machakann

Ⅲ. 安装方法

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

Build status
Build Status

The vim textobject plugin to treat function-call regions.

Default mappings are assigned to if and af.

  • if and af, both of them select a region like func(argument).
  • if and af behave differently when a function takes another function as its argument.
  • if selects the most inner function under the cursor.
  • af selects the first function including the cursor position by its parenthesis. However if any candidate would be found, it falls back to if.
             #              : 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 = 1

And 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]

添加新评论