Is there a [Go to file...]?
XcodeKeyboard ShortcutsXcode Problem Overview
In modern IDEs, there is a keyboard shortcut to open a file by typing its name without putting your hand on the mouse. For example:
-
Eclipse: Cmd|Ctrl + Shift + R -> Open Resource
-
IntelliJ: Cmd|Ctrl + Shift + N -> Open File
Is there a Go to file
or Open file
shortcut in Xcode?
Xcode Solutions
Solution 1 - Xcode
Since Xcode 4 (including 5, 6, 7, 8, 9, 10, 11, 12 and 13) it's ⌘ + ⇧ + O
Solution 2 - Xcode
Command + Shift + O is now the shortcut to find a file quickly and open it in Xcode 4
Solution 3 - Xcode
Its not quite the same, but this might interest you:
Cmd + alt + J
Opens the project navigator and highlights the search bar, ready to type.
Cmd + shift + J Just opens the project navigator.
Solution 4 - Xcode
Updated to Xcode 9.3
This is the quick guide for all the Xcode Keyboard Shortcuts:
-
Comment/ Un-comment code: ^ + /
-
Undo: ⌘ + Z
-
Redo: ⌘ + ⇧ + Z
-
Shift Right or Left: ⌘ + [ | ]
-
Indent: ⌃ + I
-
Navigate to the beginning or end of line: ⌘ + ← | →
-
Navigate word by word left or right of line: ⌥ + ← | →
-
Bring up possible auto-completion choices: esc
-
Jump To definition: ⌘ + Click
-
Put a breakpoint to a line: ⌘ + </kbd>
-
Move line up or down: ⌘ + ⌥ + [ | ]
-
Find in File: ⌘ + F
-
Find & Replace in File: ⌘ + ⌥ + F
-
Find in Project: ⌘ + ⇧ + F
-
Find & Replace in Project: ⌘ + ⌥ + ⇧ + F
-
New Tab: ⌘ + T
-
Next Tab: ⌘ + ⇧ + {
-
Previous Tab: ⌘ + ⇧ + }
-
Open Quickly: ⌘ + ⇧ + O
-
Move Focus to Editor: ⌘ + J
-
Navigate to Next File in Recently Visited: ⌘ + ⌃ + →
-
Navigate to Previous File in Recently Visited: ⌘ + ⌃ + ←
-
Show present file in Editor: ⌘ + ⇧ + J
-
Fold/ Unfold code: ⌘ + ⌥ + ← | →
-
Fold/ Unfold all methods/functions: ⌘ + ⌥ + ⇧ + ← | →
-
Fold/ Unfold all multiple line comments: ⌃ + ⇧ + ⌘ + ← | →
-
Font Size Increase/Decrease: ⌘ + + | -
-
Go to line number: ⌘ + L
-
Show Assistant Editor: ⌘ + ⌥ + Return
-
Hide Assistant Editor: ⌘ + ↩
-
Toggle Completions: ⌃ + Space
-
Edit All in Scope: ⌘ + ⌃ + E
-
Show / Hide Navigator: ⌘ + 0
-
Switch Tabs: ⌘ + 1 - 8
-
When clicking a File in Navigator open in
-
Assistant Editor: ⌥ + Click
-
New Window: Double click
-
Decide where to open: ⇧ + ⌥ + Click
-
Toggle Debug Area: ⌘ + ⇧ + Y
-
Next Issue: ⌘ + ’
-
Previous Issue: ⌘ + ”
-
Toggle Breakpoints: ⌘ + Y
-
Clear Console: ⌘ + K
-
Show / Hide Utilities: ⌘ + ⌥ + 0
-
Switch Tabs Utilities: ⌘ + ⌥ + 1 - 9
-
Build: ⌘ + B
-
Run: ⌘ + R
-
Stop: ⌘ + .
-
Analyze: ⌘ + ⇧ + B
-
Test: ⌘ + U
-
Clean: ⌘ + ⇧ + K
-
Help for Clicked Symbol: ⌥ + click
-
Documentation for clicked Symbol: ⌥ + Double click
-
Show Documentation: ⌘ + ⇧ + 0
-
Documentation for Selection: ⌘ + ⌥ + ⌃ + /
-
Move Focus to Filter in Navigator: ⌘ + ⌥ + J
-
Move Focus to Filter in Utilities: ⌘ + ⌥ + L
Solution 5 - Xcode
File → Open Quickly...
You can assign a shortcut to it in Preferences → Key Bindings. The default should be ⌘+Shift+D.
(If you have a #include
/#import
, you can place the text cursor on it and press ⌘+Shift+D to fill the file name automatically.)
Solution 6 - Xcode
If you want to jump to specific line in specific file. Then
First: Command + Shift + o
Then type CustomView:60
Means in file CustomView line number 60.
Solution 7 - Xcode
Also note that if you hold down Command and click on the name of a class, Xcode will jump you to that class' implementation.