Reputation:
Files can be quickly opened in xcode using cmd+shift+o
to get the following prompt:
Searching for a file and pressing Enter
opens it in the main editor. Option+Enter
opens the file in the assistant editor.
Is there a key combination to open the file in a new window?
Upvotes: 3
Views: 552
Reputation: 90571
You can hold down Option-Shift as you select the file and that will present a UI, the navigation chooser, to pick any existing tab/window. It also has a means to open a new window by selecting the window that just shows a plus ('+') sign. (Or a new tab by selecting the plus button in the symbolic tab bar of a window.)
That navigation chooser also supports keyboard input. You can use Command-left and Command-right to switch windows, including getting to the new-window representation.
In Xcode 11.3 (maybe any 11.x), the navigation chooser is not longer a separate UI from the regular windows. Rather, it's integrated into Xcode's open windows. When you Option-Shift select a file to open, Xcode will show a blue highlight over an editor pane of the current window. Pressing return will open the file in that pane. Pressing the right arrow will select the pane's right border to allow you to create a new pane. If there's a pane to the right, pressing right arrow again will select it. Similarly, pressing down arrow will select the bottom border and then the pane below.
If you want to insert into another existing window, use the usual window-switching shortcuts (e.g. Command-`) to switch to that window and select the destination pane. If you want to load the file into a new tab in the current window, press the keyboard shortcut for New Tab (Command-T, by default). If you want to load the file into a new window, press the keyboard shortcut for New Window (Command-Shift-T, by default).
Upvotes: 3