Search code examples
xcodexcode4

Xcode 4: Keyboard shortcut for switching Assistant Editor to Tracking (Automatic) mode?


I like using the Assistant Editor in Xcode 4. I frequently Option-Click files to open them in the Assistant Editor, or use Open Quickly (Command-Shift-O), and hold the option key when selecting a file to open it in the Assistant Editor.

Both of these actions switch the Assistant Editor to Manual mode. Is there a keyboard shortcut to switch the Assistant Editor back to Tracking mode (also called Automatic)? In tracking mode it automatically shows the counterpart, e.g. the corresponding header/implementation file for the file in your main editor. know I can select Automatic mode it with the mouse on the Assistant Editor Jump bar, but I really want a keyboard shortcut to do this.


Solution

  • In the View -> Assistant Editor menu, there's an item called "Reset Editor". The default keyboard shortcut is Cmd-Opt-Shift-Z. It resets the Assistant View to show Counterparts.

    I don't know if it's new in Xcode 4.1, but it should be a little easier than AppleScripting.

    Alternatively, you could create a behavior to reset the editor how you'd like and bind it to a keyboard shortcut.