Is it possible to Command-click a symbol into a new tab in Xcode?
Asked Answered
M

5

33

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.

Margetmargette answered 28/3, 2013 at 18:26 Comment(0)
A
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.

Aorta answered 20/1, 2014 at 14:55 Comment(2)
In case anyone is wondering, this works perfect in Xcode 5.1.1.Sianna
I would set "Optional navigation" to "Uses Separate Tab" and then use Option + ClickMalpractice
I
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)

Impostor answered 14/8, 2013 at 10:33 Comment(0)
G
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

Graehl answered 28/3, 2013 at 18:51 Comment(1)
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 (⌘⌥→).Margetmargette
S
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.

Szeged answered 25/10, 2013 at 14:33 Comment(0)
O
1

For Xcode 15: Xcode -> Settings -> Navigation: Set Optional Navigation to Uses Tab.

Now hold cmd + option then click the symbol to open it in a new tab.

Orelee answered 3/4 at 6:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.