views:

507

answers:

2

Hi,

is there a way to have Xcode append a closing bracket ")" when I type the opening one "("? I know that it does this for those {}. I really miss Textmate :( A generic way to define which chars should be automatically inserted when the opening ones are entered would be kickass.

+2  A: 

In Xcode 3.1 go to Preferences->Indentation Check Syntax-ware indenting to on and check Automatically insert closing "}"

and choose the characters you want to be inserted when the opening one is.

Also why not use Textmate nothing stops you and Xcode will notice if a file is edited externally

Mark
The place where you choose your characters is only for indentation, not to create a matching pair.
nevan
Yes sorry I misread.
Mark
+1  A: 

Have a look under Edit->Insert Text Macro->Objective C->Bracket Expression. This will insert a matched pair of brackets (or if you have something highlighted, put brackets around it). You could bind this to [ as a keyboard shortcut.

You can follow the instructions here to create one for parentheses. I tried but couldn't make it work.

http://cocoawithlove.com/2008/06/hidden-xcode-build-debug-and-template.html#textmacros

Personally, I drag the classes folder over to Textmate and edit there. I switch back to Xcode when I need to type in some long method name, or to build. I've been building a library of snippets for some of the common things I do in Textmate to make life easier there.

nevan