Xcode source automatic formatting

jslatts picture jslatts · Oct 15, 2009 · Viewed 173.9k times · Source

As a C# developer, I have become highly dependent on the automatic formatting in Visual Studio 2008. Specifically, I will use the CTRL + K , D keyboard shortcut to force things back into shape after my sloppy implementation.

I am now trying to learn Objective-C and am missing certain features in Xcode, but probably none are quite as painful as the formatting shortcut. My Google searches have yielded nothing built in, though it seems there are some hacks. Am I missing something or does this feature not exist natively in Xcode?

Answer

Ken picture Ken · Oct 15, 2009

That's Ctrl + i.

Or for low-tech, cut and then paste. It'll reformat on paste.