32

I am searching for a keyboard shortcut that allows me to combine 'Cmd-t' (open new tab) and 'Cmd-click on a symbol' (jump to definition). I want to be able to open the symbol definition in a new tab, much like Cmd-click (Ctrl-click on Windows) opens a link in a new tab when using a web browser.

I tried some different combinations but have given up after Cmd-option-Shift-click crashed Xcode!

I'm currently using Xcode 4.6.1.

kraftydevil
  • 5,144
  • 6
  • 43
  • 65

4 Answers4

45
  1. Go to XCode->Preferences,
  2. Select Navigation tab,
  3. Change "Double Click Navigation" to "Uses Separate Tab"

Now command-double-click the symbol to open in new tab.

Leigh
  • 4,268
  • 1
  • 27
  • 17
11

The easiest way I found is,

Cmd+T new tab.
Then Cmd+Click on the symbol.

I think Xcode should have, Cmd+Shift+Click to open the function/class in new tab. OR Alt+Cmd+O or something like this :)

UPDATE: It was an old trick. Now you can use @Leigh answer. Cmd + double click + (set preferences to open double click navigation in new tab)

karim
  • 15,408
  • 7
  • 58
  • 96
3

Funny you mentioned ⌘⌥⇧-click because you can open the definition in a new tab with that. Unfortunately you also need to click on the right + sign that appears in the window navigator after you do this, so it's somehow a 2 step action. I don't think there's another way to do it. Apple calls it "Jump to Definition In...", since you can choose where to open it. Also, if you're a keyboard person ^⌘⌥⇧J

Rad'Val
  • 8,895
  • 9
  • 62
  • 92
  • yep works, but for some reason that window navigator stresses my machine! If you do get it to come up then you can `↑, →, Enter` to open that tab without leaving your keyboard :) Also, `^⌘⌥⇧J` appears to work from the keyboard only after highlighting the whole symbol (`⌘⌥→`). – kraftydevil Mar 28 '13 at 19:56
2

Selecting in the editor, the one step method for this is to ⌥⌘ click. With ⌥⌘, the cursor will change to a pointing finger. Clicking opens that symbol in a new tab.

Selecting in the project navigator, use ⌘ double click.

Max MacLeod
  • 26,115
  • 13
  • 104
  • 132