是否可以在 Xcode 中通过命令单击符号进入新选项卡?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15689471/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 03:05:24  来源:igfitidea点击:

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

xcodekeyboard-shortcutshotkeys

提问by kraftydevil

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.

我正在寻找一个键盘快捷键,它允许我组合“Cmd-t”(打开新选项卡)和“Cmd-单击符号”(跳转到定义)。我希望能够在新选项卡中打开符号定义,就像使用 Web 浏览器时 Cmd 单击(在 Windows 上按住 Ctrl 键单击)在新选项卡中打开链接一样。

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

我尝试了一些不同的组合,但在 Cmd-option-Shift-click 使 Xcode 崩溃后放弃了!

I'm currently using Xcode 4.6.1.

我目前使用 Xcode 4.6.1。

回答by Leigh

  1. Go to XCode->Preferences,
  2. Select Navigation tab,
  3. Change "Double Click Navigation" to "Uses Separate Tab"
  1. 转到 XCode-> 首选项,
  2. 选择导航选项卡,
  3. 将“双击导航”更改为“使用单独的选项卡”

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

现在命令双击符号以在新选项卡中打开。

回答by karim

The easiest way I found is,

我找到的最简单的方法是,

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

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

我认为 Xcode 应该有,Cmd+Shift+Click在新选项卡中打开函数/类。或Alt+Cmd+O或类似的东西:)

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)

UPDATE:这是一个古老的伎俩。现在您可以使用@Leigh 回答。Cmd + double click + (set preferences to open double click navigation in new tab)

回答by Valentin Radu

Funny you mentioned ???-clickbecause 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

你提到的有趣,???-click因为你可以在新选项卡中打开定义。不幸的是,您还需要+在执行此操作后单击出现在窗口导航器中的正确标志,因此它在某种程度上是一个 2 步操作。我认为没有其他方法可以做到这一点。Apple 将其称为“跳转到定义于...”,因为您可以选择打开它的位置。另外,如果你是键盘侠^???J

回答by Max MacLeod

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.

在编辑器中选择,此步骤的一步方法是?? click. 使用??,光标将变为指向手指。单击可在新选项卡中打开该符号。

Selecting in the project navigator, use ? double click.

在项目导航器中选择,使用? double click.