Keyboard shortcut to go to definition

I am only looking for a keyboard shortcut to go to the definition. A mouse is required for the built-in shortcut: + Double-click.

I tried to add a regular keyboard shorcut for the menu command Edit> Find> Jump to Defintion, but, alas, it will only work if you select a method name. I would like to be able to position the cursor inside the method name, class name, or other character and press something like + Shift + L.

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

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

I sent an Apple error report.

+55
xcode keyboard-shortcuts
Feb 09 '10 at 10:05
source share
5 answers

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

+79
Jan 16 '13 at 8:44
source share

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

  • Ctrl + Command + J
  • Ctrl + Command + Left Click (One Finger)
  • Command + Right Click (Two fingers touch)

Xcode 9 only:

  1. Go to Xcode => Settings => Navigation => Change Command-click on Code to Jumps to Definition , and then use Command + Left Click (One Finger)
+21
Oct 03 '17 at 9:22 on
source share

For Xcode (tested in Swift), the following keyboard shortcuts work. Found very useful:

To go to Implementation (possibly a definition in Obj-C):

Ctrl + Command + J

Return to Previous Context :

Ctrl + Command + <

To go into the Forward context:

Ctrl + Command + >

+11
Jun 19 '15 at 15:43
source share

Try the following: Cmd + Option + (or Cmd + Shift + D and select from the list) or look at the link to rewrite shortcuts (this last option you probably already tried - you may need to choose a method).

+1
Feb 09 2018-10-10T00
source share

Maybe it can work

enter image description here

or try like this

enter image description here

0
Jan 25 '19 at 7:39
source share



All Articles