用于在编辑器和助理编辑器之间交换焦点的 Xcode 4 快捷方式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8596830/
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 22:48:32  来源:igfitidea点击:

Xcode 4 shortcut for swapping focus between editor and assistant editor

xcodexcode4

提问by Alec Gorge

In Xcode, I am big fan of the assitant editor that shows me the corresponding .h or .m for the file that I am editing.

在 Xcode 中,我非常喜欢助手编辑器,它向我显示我正在编辑的文件的相应 .h 或 .m。

Is there a shortcut that allows me to swap focus between this two windows? I frequently switch between the two and using the mouse every time is annoying.

是否有快捷方式可以让我在这两个窗口之间交换焦点?我经常在两者之间切换,每次都使用鼠标很烦人。

回答by Rudolf Adamkovi?

New answer:

新答案:

Move Focus To Editorcommandjfollowed by ///and return

将焦点移至编辑器commandj后跟/ / /return

This goes nicely together with commandshiftjwhich is Reveal in Project Navigator.

这很好地去连同commandshiftj显示在项目导航

Old answer:

旧答案:

Use optioncommand`keyboard shortcut.

使用optioncommand`键盘快捷键。

It can be remapped in Preferences- Keyboard Bindings- Move Focus To Next Area.

它可以在Preferences- Keyboard Bindings- Move Focus To Next Area 中重新映射。

Edit: Removed XVim recommendation.

编辑:删除了 XVim 建议。

回答by Robert

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

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

XCode shortcuts

XCode 快捷键

回答by Jay

@Oneiros: Not quite what the OP was asking for..

@Oneiros:不完全是 OP 所要求的..

I don't know of a 'short' shortcut but there's Cmd-Jshowing a popup where you can choose what to focus.

我不知道“短”快捷方式,但有Cmd-J一个弹出窗口,您可以在其中选择要关注的内容。

回答by Marián ?erny

Xcode 8+

Xcode 8+

This is the easiest option:

这是最简单的选择:

^`- Move Focus to Next Editor

^`- 将焦点移至下一个编辑器

When using multiple assistant editors, ?^`moves focus to previouseditor.

使用多个助理编辑器时,?^`将焦点移至上一个编辑器。

Xcode 4+

Xcode 4+

??`- Move Focus to NextArea
???`- Move Focus to PreviousArea

??`- 将焦点移至下一个区域
???`- 将焦点移至上一个区域

Using this option you can switch between Project Navigator (left pane), Primary Editor, Assistant Editors, Utility Area (right pane), Debug Area, etc.

使用此选项,您可以在 Project Navigator(左窗格)、Primary Editor、Assistant Editors、Utility Area(右窗格)、Debug Area 等之间切换。



?J- Move Focus to Editor...

?J- 将焦点移至编辑器...

Using this option you can choose where to move the focus using graphical navigation chooser.

使用此选项,您可以使用图形导航选择器选择将焦点移动到何处。

回答by hyouuu

For Xcode 4.4: Use Cmd+Option+` (left to number 1) to Move Focus to Next Area, and use Cmd+Option+Shift+` to Move Focus to Previous Area

对于 Xcode 4.4:使用 Cmd+Option+`(从左到数字 1)将焦点移动到下一个区域,并使用 Cmd+Option+Shift+` 将焦点移动到上一个区域

For Xcode 4.3: If you only have the Editor and Assistant open, use Cmd+Option+. to switch between them (Navigator>Move Focus to next area)

对于 Xcode 4.3:如果您只打开了编辑器和助手,请使用 Cmd+Option+。在它们之间切换(导航器>移动焦点到下一个区域)

回答by LightMan

Also, if you want to open a different file in the right pane, like the .xib or any other, press

此外,如果您想在右侧窗格中打开不同的文件,如 .xib 或任何其他文件,请按

Command ?shift ?o

Command ?shift ?o

The open quicklywindow will appear, search the file, use capital letters to filter through camel case notation, then press

迅速打开窗口将会出现,通过驼峰符号搜索文件,使用大写字母进行筛选,然后按

Alt ?enter ?

Alt ?enter ?

The file will be opened in the assistant window

该文件将在助手窗口中打开

回答by Oneiros

Switching between .h and .m:
Control ^Command ?Up Arrow ↑

在 .h 和 .m 之间切换:
Control ^Command ?Up Arrow ↑

回答by Nik Kov

You can do this:

你可以这样做:

Assume you have Standart(S) and Assistance(A) editor opened and you want swap them.

假设您打开了Standart( S) 和 Assistance( A) 编辑器,并且想要交换它们。

1) Double tap with holded Altto line in navigation bar of Seditor with file name (look screenshot). This file will open in Aeditor.
2) In Aeditor tap Go Backand do 1. File from Aeditor will be opened in Seditor.
3) In Aeditor tap Go Forward.

1)AltS带有文件名的编辑器导航栏中按住鼠标双击行(查看屏幕截图)。该文件将在A编辑器中打开。
2)在A编辑器中点击Go Back并执行1。来自A编辑器的文件将在S编辑器中打开。
3) 在A编辑器中点击Go Forward

DONE!

完毕!