textobj-indent


Ⅰ. 插件描述

Vim plugin: Text objects for indented blocks of lines

Ⅱ. 基本信息

创建日期:  2008-12-13
使用用户:  621
Github星:  117
插件作者:  Kana Natsuno

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'kana/textobj-indent'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'kana/textobj-indent'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'kana/textobj-indent'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

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

Ⅳ. 文档说明

textobj-indent is a Vim plugin to provide text objects to select a block of
lines which are similarly indented to the current line.

For example, if the content of a buffer as follows:
(here ">" means the current line under the cursor,
and "_" means a space to indent)

  if some_condition_is_satisfied
> __if another_condition_is_satisfied
  ____call s:do_x()
  __endif

  __...
  __endif
  else
  __...
  endif

|<Plug>(textobj-indent-a)| will select lines as follows:
(here "|" indicates the selected line)

  if some_condition_is_satisfied
>|__if another_condition_is_satisfied
 |____call s:do_x()
 |__endif
 |
 |__...
 |__endif
  else
  __...
  endif

|<Plug>(textobj-indent-i)| will select lines as follows:

  if some_condition_is_satisfied
>|__if another_condition_is_satisfied
 |____call s:do_x()
 |__endif

  __...
  __endif
  else
  __...
  endif

More variants are also available.  See |textobj-indnet-mapping| for the
details.

Requirements:

  • Vim 7.2 or later
  • |textobj-user| 0.3.8 or later (vimscript#2100)

Latest version:
http://github.com/kana/vim-textobj-indent

Document in HTML format:
http://kana.github.com/config/vim/textobj-indent.html

添加新评论