Keyboard shortcut for Jump to Definition

XcodeKeyboard Shortcutsxcode3.2

Xcode Problem Overview


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.

Xcode Solutions


Solution 1 - Xcode

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

Solution 2 - Xcode

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)

Solution 3 - Xcode

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 +

Solution 4 - Xcode

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

Solution 5 - Xcode

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

Solution 6 - Xcode

May Be it can work

enter image description here

or try this way

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionArne EvertssonView Question on Stackoverflow
Solution 1 - XcodeThomas KekeisenView Answer on Stackoverflow
Solution 2 - XcodeatulkhatriView Answer on Stackoverflow
Solution 3 - XcodeFeruView Answer on Stackoverflow
Solution 4 - XcodeNaishtaView Answer on Stackoverflow
Solution 5 - XcodeRamashalankaView Answer on Stackoverflow
Solution 6 - XcodeSteven GardnerView Answer on Stackoverflow