Xcode - 在新窗口中打开当前文件(真正的挑战!)

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

Xcode - open current file in a NEW window (a real challenge !)

xcodeshortcuts

提问by Fattie

enter image description here

在此处输入图片说明

Say you have File.m showing in the blue area above.

假设你有 File.m 显示在上面的蓝色区域。

I want File.m to open in a new separate window.

我希望 File.m 在一个新的单独窗口中打开

How to do this??

这该怎么做??

Note that - of course - IFyou have the ProjectNavigator showing and IFyou can see the filename "File.m", then double-click on the filename and it will open in a new window.

请注意 - 当然 -如果您有 ProjectNavigator 显示并且如果您可以看到文件名“File.m”,则双击文件名,它将在新窗口中打开。

What I want to do is open ANOTHERcopy of the "CURRENT"file (the one in the primaryEditor) in a NEW WINDOW- without touching the ProjectNavigator.

我想要做的就是打开ANOTHER的副本“CURRENT”的文件(一个在primaryEditor的)新的窗口-不碰ProjectNavigator。

Any ideas? Cheers

有任何想法吗?干杯



Note that ... (an excellent page here)

请注意......(这里是一个很好的页面)

http://realmacsoftware.com/blog/xcode-4-s-less-obvious-shortcuts

http://realmacsoftware.com/blog/xcode-4-s-less-obvious-shortcuts

if you click on whatever file is in the current primaryEditor, then shift option apple commathat will indeed open the following "freaky little-known Xcode popup" ...

如果您单击当前主编辑器中的任何文件,然后切换选项苹果逗号确实会打开以下“奇怪的鲜为人知的 Xcode 弹出窗口”...

enter image description here

在此处输入图片说明

you can then, indeed, choose to open a new window. (So to be clear, that is exactly what I want to do.)

然后,您确实可以选择打开一个新窗口。(所以要清楚,这正是我想要做的。)

So, I want to be able to do that in one step. Cheers!

所以,我希望能够一步完成。干杯!

回答by Max Chuquimia

In XCode's Preferences you can change the following: xcode preferences

在 XCode 的首选项中,您可以更改以下内容: Xcode 首选项

And then right-click within the primary editor and click "Open in Separate Window"

然后在主编辑器中右键单击并单击“在单独的窗口中打开”

Edit:Instead of right clicking in the primary editor you can simply type command+option+,(comma)

编辑:无需在主编辑器中右键单击,您只需键入command+ option+ ,(逗号)

回答by Thomas Keuleers

I wrote a new automator service that does the following steps in Xcode:

我编写了一个新的自动化服务,它在 Xcode 中执行以下步骤:

  1. Execute the default shortcut for the "Open in..." menu item (Command-O) (if this isn't your current "Open in" shortcut, the workflow will not work. If you still want to test it, just changed your default shortcut :) )
  2. Go all the way to the left in the weird "Open in" view
  3. hit Enter
  4. Current file opened in new window
  1. 执行“打开方式...”菜单项的默认快捷方式(Command-O)(如果这不是您当前的“打开方式”快捷方式,则工作流程将不起作用。如果您仍想测试它,只需更改您的默认快捷方式 :) )
  2. 在奇怪的“打开方式”视图中一直向左走
  3. 按 Enter
  4. 在新窗口中打开的当前文件

The only thing you need to do is install the service on osx and map a shortcut to it.

您唯一需要做的就是在 osx 上安装该服务并为其映射一个快捷方式。

Here a download to the service: https://www.dropbox.com/s/486t2iz17o0l9dh/Open-New-Window.zip

这里是该服务的下载:https: //www.dropbox.com/s/486t2iz17o0l9dh/Open-New-Window.zip

INSTALL INSTRUCTIONS

安装说明

1.Place Service file in folder ~/Library/Services 2. Open "System preferences" 3. > Keyboard 4. > Tab "ShortCuts" > "Service" > "General" 5. > Set your own shortcut for the service 6. Go to XCode and test the service by using your very own shortcut

1.将服务文件放在文件夹 ~/Library/Services 2. 打开“系统首选项” 3. > 键盘 4. > 选项卡“快捷方式” > “服务” > “常规” 5. > 为服务设置自己的快捷方式 6.转到 XCode 并使用您自己的快捷方式测试该服务

Tested on OS X Mavericks, Xcode 5.0.1

在 OS X Mavericks、Xcode 5.0.1 上测试

回答by Wanbok Choi

  1. Open the file what you want to open in the separated window.
  2. Cmd+ Shift+ t
  3. That's it
  1. 在分离的窗口中打开要打开的文件。
  2. Cmd+ Shift+t
  3. 就是这样

BTW, just Cmd+ tis the open file in the assistance editer

顺便说一句,只是Cmd+t是辅助编辑器中打开的文件

回答by azmuhak

In XCode 4 you can have a split window via View -> Show Assistant Editor. Then choose the same file which you have already opened in the Primary editor by the small right arrows on top of Assistant Editor.

在 XCode 4 中,您可以通过 View -> Show Assistant Editor 来创建一个拆分窗口。然后通过助理编辑器顶部的小右箭头选择您已经在主编辑器中打开的相同文件。

Thanks

谢谢

回答by Brian

in the ProjectNavigator. If you see the file name: Double click on the file name. It will open in a new window.

在 ProjectNavigator 中。如果您看到文件名:双击文件名。它将在新窗口中打开