Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I indent multiple lines in Xcode?

When I select multiple lines of code and want to indent them as usual with TAB key, it just deletes them all. I come from Eclipse where I always did it that way. How's that done in Xcode? I hope not line by line ;)

like image 841
Thanks Avatar asked May 06 '09 14:05

Thanks


People also ask

How do you indent multiple rows?

You can select multiple rows (select the first row in the far left and hold down shift and select the last row) and then use the Indent/Outdent feature to change them.

How do I change indentation in Xcode?

Choose Xcode > Preferences… from the menu bar (default shortcut: command-comma). Then click the “Text Editing” section. Then choose the “Indentation” tab.

How do you indent a set of lines?

To indent the first line of a paragraph, put your cursor at the beginning of the paragraph and press the tab key. When you press Enter to start the next paragraph, its first line will be indented.


2 Answers

The keyboard shortcuts are +] for indent and +[ for un-indent.

  • In Xcode's preferences window, click the Key Bindings toolbar button. The Key Bindings section is where you customize keyboard shortcuts.
like image 112
JWD Avatar answered Oct 06 '22 07:10

JWD


Select your code to reindent, then Go to

Editor -> Structure -> Re-Indent

like image 29
JavierGiovannini Avatar answered Oct 06 '22 09:10

JavierGiovannini