Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to assign a shortcut key to the "Jump To Definition" context menu item in XCode.

How?

share|improve this question
add comment

3 Answers

You did not mention which version of Xcode you are using, but here is how to do it in Xcode 2.5 (on 10.4/Tiger):

Since Jump to Definition is also an item in the Find menu, we can easily customize its binding. The item in the Find menu has the same effect as the menu item in the contextual menu. You can do this kind of main menu item key binding through System Preferences for applications that do not offer built-in binding customization.

  1. Xcode menu > Preferences…
  2. Keybindings section (horizontal scroll area at the top of the preferences window)
  3. Menu Key Bindings tab
  4. Click the disclosure triangle for Find (make it point down)
  5. Find Jump to Definition, double-click in its Key column
    • If you have not previously changed any key bindings, it will tell you that the currently selected binding set is owned by the system. If this dialog comes up:
      1. Click the Make Copy button
      2. Enter a name for your key binding set
      3. Again, double-click on the Key column for Jump to Definition
  6. Press the key combination you want to use (e.g. Command-Shift-J).
  7. Click on another line the Action/Key table to exit ‘key assignment mode’.
  8. Click OK or Apply to activate the new key binding(s).
share|improve this answer
    
This works in the latest XCode as well (3.2.1 on Snow Leopard as of 1-25-2010). –  alesplin Jan 26 '10 at 6:35
add comment

Or you could set it in your .pbxkeys keybindings file as something like

<key>^i</key><string>jumpToSelectionDefinition:</string>

share|improve this answer
add comment

Although a little offtopic I found this article helpful since I was searching for a way to apply a shortcut ...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.