XCode: Function argument indentation XCode: Function argument indentation xcode xcode

XCode: Function argument indentation


XCode (at least the version I have, 3.1.3) has a preferences pane called "indentation" that lets you click on/off a checkmark next to several characters such as semicolon, return,etc.

If you turn OFF the checkmark for return and semicolon, you can control the most important parts of your own indenting.

For instance, I declare my variables at the head of the function, and I like them flush; whereas XCode as first installed insisted on bringing them to the same level as the code.

I turned off the semicolon, and presto, it'll leave them there. Most of the time. It still screws them up during copy/pasta actions, but mostly it behaves. :)


One solution could be to put the parentheses on the new line too. You will have something like this:

auto somevariable = pow  (a,   b);

Not the most elegant solution but the most effective if you want an automatically indentation from Xcode and if you are under a number of line constraint.