353

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?

Alexander Abakumov
  • 13,617
  • 16
  • 88
  • 129
Mike
  • 8,853
  • 3
  • 35
  • 44

7 Answers7

744

Since Xcode 4 (including 5, 6, 7, 8, 9, 10, 11, 12, 13 and 14) it's + + O

Eimantas
  • 48,927
  • 17
  • 132
  • 168
54

Command + Shift + O is now the shortcut to find a file quickly and open it in Xcode 4

Jasper
  • 2,166
  • 4
  • 30
  • 50
djones
  • 1,369
  • 10
  • 15
41

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.

Nils Munch
  • 8,805
  • 11
  • 51
  • 103
  • Cmd-Shift-J will do more than just open the project navigator. It'll do that and select the file that's open in the editing area. To Just open the project navigator, use Cmd-1 (or Cmd-2, Cmd-3 to open other navigators), or Cmd-0 to close them all. – Sanjay Chaudhry Jan 20 '16 at 23:10
  • Actually Cmd-Alt-J will will open whichever navigator was open last and highlight the search bar. – Sanjay Chaudhry Jan 20 '16 at 23:14
21

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: + \

  • 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

amq
  • 160
  • 4
  • 17
Rein rPavi
  • 3,368
  • 4
  • 22
  • 32
5

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.)

Mwiza
  • 7,780
  • 3
  • 46
  • 42
kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
2

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.

Yogendra Singh
  • 2,063
  • 25
  • 20
2

Also note that if you hold down Command and click on the name of a class, Xcode will jump you to that class' implementation.

Jeffrey Wear
  • 1,155
  • 2
  • 12
  • 24