Ⅰ. 插件描述
Extend the % motion and define g%, [%, and ]% motions for Python filesⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'lambacck/python-matchit'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'lambacck/python-matchit'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'lambacck/python-matchit'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/lambacck/python_matchit
Ⅳ. 文档说明
This script redefines the % motion so that (in addition to its usual behavior)
it cycles through if/elif/else, try/except/catch, for/continue/break, and
while/continue/break structures. The script also
defines g% to cycle in the opposite direction. Two other motions, [% and ]%,
go to the start and end of the current block, respectively.
All of these motions should work in Normal, Visual, and Operator-pending
- For example, d]% should delete (characterwise) until the end of the
- block; v]%d should do the same, going through Visual mode so that
you can see what is being deleted; and V]%d makes it linewise.