Match Bracket for Objective-C : Automatically inserts matching starting bracket when ] is pressed.
Vim script
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is a mirror of

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!