vim-textobj-methodcall


Ⅰ. 插件描述

A Vim text-object for either single or chained method calls.

Ⅱ. 基本信息

创建日期:  2016-06-12
使用用户:  3
Github星:  28
插件作者:  Thales Mello

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'thalesmello/vim-textobj-methodcall-please-everybody'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'thalesmello/vim-textobj-methodcall-please-everybody'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'thalesmello/vim-textobj-methodcall-please-everybody'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/thalesmello/vim-textobj-methodcall

Ⅳ. 文档说明

# vim-textobj-methodcall

This plugin defines a methodcall text objt for the vim-textobj-user plugin.

demo

Installing

With vim-plug:

Plug 'kana/vim-textobj-user' | Plug 'thalesmello/vim-textobj-methodcall'

Default mappings

  • am: around method call. Gets the method call of the surrounding scope.
  • im: inner method call. Gets the method call of the current scope.
  • aM: around method call chain. Gets the method call chain of the surrounding scope.
  • iM: inner method call chain. Gets the method call chain of the current scope.

Custom mappings

call textobj#user#map('methodcall', {
      \   '-': {
      \     'select-a': 'ac',
      \     'select-i': 'ic',
      \   },
      \   'chain': {
      \     'select-a': 'aC',
      \     'select-i': 'iC',
      \   },
      \ })
let g:textobj_methodcall_no_default_key_mappings = 1

For more details, look at the vim-textobj-user documentation.

添加新评论