Match Bracket for Objective-C


Ⅰ. 插件描述

Automatically inserts matching starting bracket when ] is pressed.

Ⅱ. 基本信息

创建日期:  2009-02-27
使用用户:  10
Github星:  4
插件作者:  Michael Sanders

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'qqshfox/match-bracket-for-objective-c'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'qqshfox/match-bracket-for-objective-c'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'qqshfox/match-bracket-for-objective-c'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/Match-Bracket-for-Objective-C

Ⅳ. 文档说明

This is a mirror of http://www.vim.org/scripts/script.php?script_id=2558

This is essentially TextMate's "Insert Matching Start Bracket" feature implemented in vim script. Makes it a lot more pleasant to write Objective-C.

Just type ] in insert mode after an object or method you want to wrap in brackets and this will wrap it appropriately; to escape out of it once you're finished, simply type ] again.

For instance, where | is the cursor:

"foo|" becomes "[foo |]" after ] is pressed.
"foo bar|" becomes "[foo bar]|"
"foo: bar|" becomes "foo: [bar |]"
"foo bar: baz|" becomes "[foo bar: baz]|"

Certain useful keywords are also wrapped intelligently, for example:
"return foo|" becomes "return [foo ]|"
"@selector: foo|" becomes "[@selector: foo]|"

Hope you like it!

添加新评论