Xcode 用同一个文件打开两个编辑器窗口

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

Xcode open two editor windows with same file

iphonexcode

提问by John Smith

Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor windows.

是否可以在 Xcode 的两个单独窗口中打开同一个文件。我可以在一个窗口中打开一个文件,在主 Xcode 编辑器窗口中打开同一个文件,但我想要两个单独的全职编辑器窗口。

采纳答案by Carl Norum

Yes. Right-click the filename in the main XCode window and pick "Open in Separate Editor". Every time you do that, you get a new complete editor window.

是的。右键单击 XCode 主窗口中的文件名,然后选择“在单独的编辑器中打开”。每次这样做时,您都会获得一个新的完整编辑器窗口。

回答by znq

In XCode 4 you can have a split window via View-> Show Assistent Editor.

在 XCode 4 中,您可以通过View-> 来分割窗口Show Assistent Editor

You can then select the file to display in the main editor by clicking on it, and the file in the assistent editor by holding down alt(or: option) + click on it.

然后,您可以通过单击来选择要在主编辑器中显示的文件,并通过按住alt(或:option)+ 单击来选择要在辅助编辑器中显示的文件。

回答by ken

Xcode 5.1 doesn't have the "Open in Separate Editor" menu option mentioned in the accepted answer. By digging through Xcode Preferences, I found hints (under Navigation) that led me to this solution:

Xcode 5.1 没有接受的答案中提到的“在单独的编辑器中打开”菜单选项。通过深入研究 Xcode Preferences,我发现了一些提示(在 Navigation 下)引导我找到了这个解决方案:

Option + Shift + Clickon the file in the project navigator. In the popup that appears, the leftmost choice is "Open in a new window".

Option + Shift + Click在项目导航器中的文件上。在出现的弹出窗口中,最左边的选项是“在新窗口中打开”。

To remember this, I found it handy to think of it as adding the Shiftkey to the Option + Clickcommand that opens the file in the assistant editor.

为了记住这一点,我发现将其视为将Shift密钥添加到Option + Click在助手编辑器中打开文件的命令很方便。

To choose the "Open in a new window" item in the popup, you can either navigate to it via mouse clicks then double-click on it, or use the keyboard: Command + Left Arrow, then Return.

要在弹出窗口中选择“在新窗口中打开”项,您可以通过单击鼠标导航到它然后双击它,或者使用键盘:Command + Left Arrow,然后Return

回答by Mr. Berna

Alternatively, you can split an Xcode editor window, so you can view multiple parts of one file in a single editor window. Just click the little split window icon above the up and down scroll bar.

或者,您可以拆分 Xcode 编辑器窗口,以便在单个编辑器窗口中查看一个文件的多个部分。只需单击上下滚动条上方的小拆分窗口图标即可。

回答by Marek Balá?

CMD + SHIFT + T

This shortcut will "duplicate" your Xcode window and open it so many times as you want.

此快捷方式将“复制”您的 Xcode 窗口并根据需要多次打开它。