This is a fork of excellent Ciarán Walsh's xcode plug-in which makes writing Obj-C easier, by automatically inserting paired message sending brackets. Watch the screencast to see how it works.
This fork adds Xcode 4 support and some extra features that makes Xcode editing feel more like TextMate:
-
Auto closing of brackets and quotes: When you open a bracket or (double)quote, the plugin closes it for you and places the cursor (insertion point) between brackets (quotes).
-
Auto deletion of both brackets: When the cursor (insertion point) is between empty brackets (quotes), pressing backspace (delete) removes them both.
-
]
always wraps: Pressing]
when there is something selected, wraps the selection with square brackets, rather than replacing whole selection with]
.
- Open the project and build the plug-in.
- After a successful build the plug-in should automatically be installed; to install it manually move the product (
XcodeBracketMatcher.pbplugin
) to~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
(create the directory if necessary). - Restart Xcode.
When editing an Objective-C(++) or Objective-J file, you can type a ]
to add a message to the current line. The plug-in will automatically look backwards to insert the opening bracket at the appropriate location.
The bracket placement logic (i.e. most of the hard work) was already done by Joachim Mårtensson for the Objective-C TextMate bundle, found here inside the parser.rb
script.