Ⅰ. 插件描述
Vim text object for multiline matchit pairsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'adriaanzon/vim-textobj-matchit'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'adriaanzon/vim-textobj-matchit'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'adriaanzon/vim-textobj-matchit'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/adriaanzon/vim-textobj-matchit
Ⅳ. 文档说明
A Vim plugin that creates text objects from matchit pairs, to be used with:
- Ruby (
if…end,def…end) - Blade (
@section…@endsection) - Shell (
if…fi,for…done) - Vim script (
if…endif,for…endfor) - :man_shrugging: Any other filetype that defines similar matchit pairs
:package: Installation
Depends on vim-textobj-user and matchit.
Plug 'kana/vim-textobj-user'
Plug 'adriaanzon/vim-textobj-matchit'
runtime macros/matchit.vimIt's likely that matchit is already enabled. You can check so by running:echo g:loaded_matchit. It will return 1 when it's enabled.
:sparkles: Usage
Textobj-matchit maps 2 keystrokes: am and im. They work like any other text
object: am selects the all of the matchit pair, im the inner portion of
the matchit pair.
See :h textobj-matchit for more details, including
instructions on how to define your own key mappings.
:man_teacher: History
This plugin derives from vim-textobj-rubyblock and
vim-textobj-blade-directive. I wanted something
similar that works for every filetype, so that is why I created this plugin.
:page_facing_up: License
Copyright © Adriaan Zonnenberg. Distributed under the same terms as Vim itself.
See :help license.