Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any shortcut key to align code content in Xcode?

Is there any shortcut key to align code in Xcode? Just like Ctrl+K+D in Visual Studio?

like image 686
user532445 Avatar asked Jan 15 '11 07:01

user532445


People also ask

How do I arrange code in Xcode?

Select first the text you want to format and then press Ctrl + I . Use Cmd + A first if you wish to format all text in the selected file. Note: this procedure only re-indents the lines, it does not do any advanced formatting.

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 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 I jump a particular line in Xcode?

Jump to Line ( ⌘ + L )


2 Answers

+ i (ctrl + i) is the shortcut key equivalent to Editor > Structure > Re-Indent ( in Xcode 6.4)

This will re-indent the line the cursor is on if no text is selected, or it will re-indent your selection.

like image 61
McGordon Avatar answered Sep 19 '22 21:09

McGordon


1.) Select the text you want to align,

then

2.) press ctrl(^) + I.

like image 38
Sarfaraz Khan Avatar answered Sep 19 '22 21:09

Sarfaraz Khan