Xcode 4:用于将助手编辑器切换到跟踪(自动)模式的键盘快捷键?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6710957/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 21:29:40  来源:igfitidea点击:

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

xcodexcode4

提问by Jeremy

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.

我喜欢在 Xcode 4 中使用 Assistant Editor。我经常使用 Option-Click 文件在 Assistant Editor 中打开它们,或者使用 Open Quickly (Command-Shift-O),并在选择文件时按住 option 键在助理编辑。

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.

这两个操作都将助理编辑器切换到手动模式。是否有将助理编辑器切换回跟踪模式(也称为自动)的键盘快捷键?在跟踪模式下,它会自动显示对应文件,例如主编辑器中文件的相应头文件/实现文件。知道我可以在助理编辑器跳转栏上用鼠标选择自动模式,但我真的想要一个键盘快捷键来做到这一点。

回答by Robert

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

我这样做是为了帮助回答另一个问题......它有帮助吗?

enter image description here

在此处输入图片说明

回答by JimDusseau

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.

在 View -> Assistant Editor 菜单中,有一个名为“Reset Editor”的项目。默认键盘快捷键是 Cmd-Opt-Shift-Z。它重置助手视图以显示对应物。

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

我不知道它是否是 Xcode 4.1 中的新功能,但它应该比 AppleScripting 容易一些。

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

或者,您可以创建一个行为来重置您想要的编辑器并将其绑定到键盘快捷键。

回答by zev

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:

您可以做到,但不能仅使用单个“标准”键盘快捷键。假设您刚刚在文件上单击 Option 并在助手编辑器中打开它,您将执行以下步骤以在助手编辑器中切换到“对应物”模式:

  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.
  1. 如果您的注意力不在助理编辑器上,请按 Command-Option-。直到你开始。
  2. 一旦焦点位于助理编辑器上,按 Control-4 以下拉助理编辑器菜单。
  3. 将选择“手册”,因此按一次向下箭头选择“对应文件”,然后按 Enter 切换到主编辑器中文件的对应文件。

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.

如果击键次数过多,您可以将步骤 2 和 3 的键放在 AppleScript 脚本中并将其绑定到一个键。