开发者

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

开发者 https://www.devze.com 2023-03-20 20:12 出处:网络
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

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 reall开发者_如何学Cy want a keyboard shortcut to do this.


I made this to help answer another question... Does it help?

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


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.


You can do it, but not with just a single "standard" keyboard shortcut. Assuming that you have just Option-Clicked on a file and opened it in the Assistant Editor, you would do the following steps to switch to "Counterparts" mode in the Assistant Editor:

  1. If your focus is not on the Assistant Editor, press Command-Option-. until you are on it.
  2. Once focus is on the Assistant Editor, press Control-4 to drop down the Assistant Editor menu.
  3. "Manual" will be selected so Press DownArrow once to select "Counterparts" and press Enter to switch to the counterpart of the file in the main editor.

If this is too many keystrokes, you can put the keys for steps 2 & 3 in an AppleScript script and bind it to a key.

0

精彩评论

暂无评论...
验证码 换一张
取 消