跳转到定义的键盘快捷键

发布于 2024-08-21 08:56:29 字数 443 浏览 4 评论 0原文

我正在寻找一个仅用于跳转到定义的键盘快捷键。内置快捷方式需要鼠标: + 双击

我尝试为“编辑”>“查找”>“跳转到定义”菜单命令添加常规键盘快捷键,但是,唉,它仅在选择方法名称时才起作用。我希望能够将光标定位在方法名称、类名称或其他符号内,然后点击类似 +Shift+L< /kbd>。

有谁知道解决该问题的方法,也许使用脚本?

更新:键盘快捷键有时有效,有时无效。当我将文本光标定位在不带参数的方法调用上并按 +Shift+L 时,它会将我带到定义。但它不适用于采用 id 参数的方法。但是,如果参数是 int,则它可以工作。

我已向 Apple 提交了错误报告。

I'm looking for a keyboard only shortcut for Jump to Definition. The built-in shortcut requires the mouse: + Double click.

I've tried to add a regular keyboard shorcut for the Edit>Find>Jump to Defintion menu command, but, alas, it will only work when the method name is selected. I'd like to be able to position the cursor within the method name, class name, or other symbol, and hit something like +Shift+L.

Does anyone know of a solution, perhaps using a script, for the problem?

Update: The keyboard shortcut works sometimes and sometimes not. When I position the text cursor on a method call with no parameters and press +Shift+L it takes me to the definition. But it doesn't work for a method that takes an id parameter. However it works if the parameter is an int.

I have submitted a bug report to Apple.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

无人问我粥可暖 2024-08-28 08:56:29

在 Xcode 4.5.2 中,快捷方式现在是 ^ + + J (更易读 Ctrl + Cmd + J)。

In Xcode 4.5.2 the shortcut now is ^ + + J (more readable Ctrl + Cmd + J).

ζ澈沫 2024-08-28 08:56:29

对于跳转到定义功能,您有以下4选项:

  1. Ctrl + Command + J< /kbd>
  2. Ctrl + Command + 左键单击(单指点击)
  3. Command + 右键< /kbd>(两根手指点击)

仅限 XCode 9:

  1. 转至
    Xcode =>偏好=>导航=>更改 按住 Command 键并单击代码
    跳转到定义,然后使用Command + 左键单击(用一根手指点击)

For Jump to Definition feature, you have the following 4 options:

  1. Ctrl + Command + J
  2. Ctrl + Command + Left Click (One finger tap)
  3. Command + Right Click (Two fingers tap)

XCode 9 only:

  1. Go to
    Xcode => Preferences => Navigation => Change Command-click on Code
    to Jumps to Definition and then use Command + Left Click (One finger tap)
姐不稀罕 2024-08-28 08:56:29

对于 XCode(在 Swift 中测试),可以使用以下键盘快捷键。发现非常有用:

转到实现(可能在 Obj-C 中定义):

Ctrl + Command + J

弹回到上一个上下文

Ctrl + Command +

转到前向上下文 :

Ctrl + 命令 +

For XCode (tested in Swift) following keyboard shortcuts work. Found very useful:

To go to the Implementation (probably definition in Obj-C) :

Ctrl + Command + J

To pop back to Previous context :

Ctrl + Command +

To go to the Forward context :

Ctrl + Command +

送君千里 2024-08-28 08:56:29

Xcode Preferences -> 中更改它导航非按键绑定
输入图像描述这里

Change it in Xcode Preferences -> Navigation , NOT Key Bindings
enter image description here

℉絮湮 2024-08-28 08:56:29

尝试以下操作:Cmd+Option+(或Cmd+Shift+ D 并从列表中选择)或查看此链接重新分配快捷方式(最后一个选项可能是您已经尝试过的 - 它可能需要选择方法)。

Try the following: Cmd+Option+ (or Cmd+Shift+D and select from list) or see this link re assigning shortcuts (this last option is probably what you tried already - it may require selecting the method).

独自←快乐 2024-08-28 08:56:29

也许它可以工作

在此处输入图像描述

或尝试这种方式

在此处输入图像描述

May Be it can work

enter image description here

or try this way

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文