Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Formatting In Xcode

Is there anyway to format the code in Xcode like you can do in Eclipse or Netbenas. I have not found any option in menu, is there any hot key for this or its simply not in Xcode?

like image 934
itsaboutcode Avatar asked Oct 02 '09 17:10

itsaboutcode


People also ask

Does Xcode have Formatter?

In the Xcode menu click [Editor] -> [Swimat] -> [Format] then the current active file will reformat. You can also create a hot-key in [Xcode] -> [Preferences..]

How do I fix format in Xcode?

Xcode can fix this with one shortcut: select the code you want to fix, then press Ctrl+I to reindent it.

How do I align in Xcode?

Select the text you want to Align And then press Control(ctrl)+I.


2 Answers

In Xcode 4, it's been moved to Editor > Structure > Re-Indent command (and has a default shortcut of CTRL+I ).

like image 134
Dylan Markow Avatar answered Sep 23 '22 18:09

Dylan Markow


Select some text and then: Edit->Format->Re-Indent

You can bind this to a hotkey in the preferences.

like image 30
nall Avatar answered Sep 21 '22 18:09

nall