Xcode Shortcuts
Below are some shortcuts that you might find useful if you use Xcode.
You can find more shortcuts in Apple’s Xcode Keyboard Shortcuts and Gestures guide.
Window
Shortcut | Description |
---|---|
⌘-T |
Open new tab |
Shift-Command-[ or
Shift-Command-] |
Switch between tabs |
Command-Enter |
Show the Standard Editor |
Option-Command-Enter |
Show the Assistant Editor |
Shift-Command-Y |
Show the Debug Area |
Option-click |
Hold Option while clicking on a file in the Project navigator to open it in the Assistant Editor |
Option-Shift-click |
Hold Option and Shift while clicking on a file in the Project navigator to open it in a specific area in Xcode’s window. Use arrow keys and return key while doing that. |
Navigation
Shortcut | Description |
---|---|
Control-Command-↑ or
Control-Command-↓ |
Switch between .h and .cpp files |
Control-Command-← or
Control-Command-→ |
Go back/forward |
Command-Shift-O |
Open Quickly. Quickly go to any file or symbol (e.g., function) by typing its name. |
Command-L |
Go to line number |
Control-L |
Scroll (vertically) to center selected line |
Control-6 |
Jump to function in the current file |
Command-click on symbol (e.g., variable or function) |
Go to defintion |
Editing
Shortcut | Description |
---|---|
Command-/ |
Comment out current line or selected block of code |
Command-\ |
Add or remove breakpoint on the current line |
Command-Control-E |
Edit all in scope |
Control-I |
Auto-indent selected text |
Option-Command-[ |
Move line up |
Option-Command-[ |
Move line down |
Command-[ |
Indent left |
Command-] |
Indent right |
Command/Option-Delete/Shift/←/→ |
Delete/select/move cursor quicker |
Command-↑ |
Go to top of file |
Command-↓ |
Go to bottom of file |
Option-Command-← |
Fold function/class |
Option-Command-→ |
Unfold function/class |
Building/Running
Shortcut | Description |
---|---|
Command-R |
Build and run |
Command-B |
Build |
Control-Command-R |
(Or click Run button while holding Control) Run without building |
Miscellaneous
Shortcut | Description |
---|---|
Command-, |
Open preferences |