xcode 11 Close secondary editor shortcut - xcode11

Is there a shortcut to close all other editors except focused one?
Previously I would open a file with option so it would show as a second editor. When I was done with the second editor, I would "close" it by using show editor only (command + return). With xcode 11, the second editor isn't part of the assistant editor. So, I can't "close" it with show editor only.
In simple terms.. Is there a shortcut to close the right editor and only show the left one.

I think SHIFT+CONTROL+CMD+RETURN is exactly what you are looking for (Note: you should be "focused" on left editor to close right).
Helpful link about new Xcode 11 assistant editor behavior:
https://www.avanderlee.com/xcode/xcode-assistant-editor/

The shortcut to close the current active editor is:
ctrl + ⌥ option + ⌘ command + W
This answer contains many more options

Related

Xcode 11.5 Assistant editor show any file

I want to be able to open any file in the assistant editor. Right now it is forcing me to open "counterparts", "test classes" and other stuff that i dont need.
I need two different classes to look at.
In previous xcodes it was possible
Where is this option in Xcode 11?
You can either alt + click in the file navigator to open in a new editor, or click this icon:
(pro tip: hold alt to toggle new editor position [on right | below])
Also, alt + click on a file while more than one editors are open will open the file in the non focused one.
Finally, ctrl + alt + cmd + click on a symbol will open that symbol in a new editor (or to the secondary if you got more than one).
Bonus: alt + enter on a quick open result (cmd + shift + O) will save you the trip to the file navigator.
Don't use the assitant editor, simply click on the "+" icon in the top right
"Add editor on right"

Xcode 11 how to use editor and assistant editor

In Xcode 10 I used the shortcut cmd + alt to open a second editor and cmd + return to close the second one.
In Xcode 11 I can open a second editor using cmd + alt but cmd + return is not working.
Clicking Show Editor Only isn't working as well.
What am I missing?
Thanks
Look 2 menu items further down.
To open and close a second editor you can press ⌃⌥⌘↩

Xcode 9 Jump to definition in a new tab, window, or other navigation area with Option-Shift-Command+Click

Xcode 9 seems to be missing jump to definition shortcut Option-Shift-Command+Click. You used to be able to use to open definition in a new tab, window, or other navigation areas with Option-Shift-Command+Click. In Xcode 9 this still works from the file navigator but not when you use this on a class. Has anyone been able to figure out how to use this shortcut in xcode 9?
You can use Xcode preferences to personalise the double click and the action selector.
From this window you can change CMD + click to open the definition instead of the action selector (as it was in Xcode 8)
you can also change the behaviour of optional navigation, so that it opens a tab
By setting the configuration as shown below, you can CMD + ALT + click to jump to definition in a new tab.
This also restores Option-Shift-Command+Click to show the window selector as you wanted
Marco's screenshot was helpful.
The keyboard commands for Xcode 9 have changed:
Jump to Definition
Same window : Command-Control-click (was Command-double-click)
In assistant pane : Command-Option-Control-click
In separate window/pane : Command-Option-Control-Shift-click
Quick Help
Option-click (same as Xcode 8)
As soon as I asked a question I found a solution by accident.
Command + click on the class to bring up the new action selector
Shift + Alt + Click to chose where to open (tab, new window, etc)
Alternatively, can use Command + Option + Control + Shift to do this all at once but I'm not sure how convenient that is
First, Open the file.
Then:
New Window : Cmd + Shift + t
The Assistance Editor : Cmd + t

Xcode: Is it possible to 'Open Quickly' the right pane of the Assistant Editor?

Is it possible to 'Open Quickly' in the right pane of the Assistant Editor? This would increase productivity by like 20x
Yes it's possible, but depending on your Xcode version you may need to adjust the default behavior in Xcode's preferences.
Use ⌘ command+⇧ shift+O to open the "Open Quicky" input box, and then:
Use ⌥ option+Enter to open the file in the right editor.
Use ⌥ option+Shift+Enter to select where you want to open the file using the arrow keys.
On Xcode 12, the default action of ⌥ option+Enter is to open the file in a new "Tab" (which are new in this release, and different from a "Window Tab"). This is still configurable in the preferences.
On Xcode 11, you can split the editor as much as you want. This means ⌥ option+Enter by default will open the file in the editor next to where your cursor currently is.
This behavior is configurable in Xcode's Preferences, under Navigation:
To have ⌥ option+Enter open the selected file in the editor on the right of the Xcode window, select "Optional Navigation: Uses Second Editor".
Make sure that Uses Focused Editor is selected in Preferences > Navigation:
This way, you can open it by focusing the Assistant Editor, pressing ⌘ command+⇧ shift+O to open the Open Quicky input box, and just press Enter to open the selected file, instead of ⌥ alt+Enter.
An even easier way is to hold down the Option key and then click on the file. That will bring open the chosen file in the Assistant Editor. This works great when you TDD your Swift :) You can have your tests on the left and option click on the implementation to open on the right.
Cool thing!
Just to extend the answer you can switch between more then two Tabs or open it new editor tab cool isn't it?
• Open multiple assistant editor .
• ⌘ command+⇧ shift+O.
• Hold ⌥ option and press Enter on the selected item.(Used to open any file in Assistant Editor)
• You can also use ⌥ option+⇧ shift+Enter to toggle more and
open new tab if you're not on stacked editor.
• The multiple selection window will appear
Note: Make sure you have all editor stacked selected
In addition to Guillaume's answer, be mindful that the editor is not in the single editor mode (I don't know what it should be called officially though) that you can disable by selecting this button, otherwise all navigations become "Uses Focused Editor":
EDIT: misread your question above answer is good, just make sure you click into that pane before trying those commands
Sounds like your looking for some hotkeys, check here for a full list
http://spin.atomicobject.com/2014/03/23/xcode-keyboard-shortcuts/
http://iphonedev.tv/blog/2014/9/15/14-xcode-time-saving-shortcuts-memorize-and-improve-your-productivity
http://nshipster.com/xcode-key-bindings-and-gestures/
but to open assistant editor use ⌘ command + ⌥ option + ↵ return

Xcode 4 shortcut for swapping focus between editor and assistant editor

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.
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.
New answer:
Move Focus To Editor — commandj followed by ←/↑/↓/→ and return
This goes nicely together with commandshiftj which is Reveal in Project Navigator.
Old answer:
Use optioncommand` keyboard shortcut.
It can be remapped in Preferences - Keyboard Bindings - Move Focus To Next Area.
Edit: Removed XVim recommendation.
#Oneiros: Not quite what the OP was asking for..
I don't know of a 'short' shortcut but there's Cmd-J showing a popup where you can choose what to focus.
I made this to help answer another question... Does it help?
Xcode 8+
This is the easiest option:
^` - Move Focus to Next Editor
When using multiple assistant editors, ⇧^` moves focus to previous editor.
Xcode 4+
⌥⌘` - Move Focus to Next Area
⇧⌥⌘` - Move Focus to Previous Area
Using this option you can switch between Project Navigator (left pane), Primary Editor, Assistant Editors, Utility Area (right pane), Debug Area, etc.
⌘J - Move Focus to Editor...
Using this option you can choose where to move the focus using graphical navigation chooser.
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
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)
Also, if you want to open a different file in the right pane, like the .xib or any other, press
Command ⌘shift ⇧o
The open quickly window will appear, search the file, use capital letters to filter through camel case notation, then press
Alt ⌥enter ↵
The file will be opened in the assistant window
Switching between .h and .m:
Control ^Command ⌘Up Arrow ↑
You can do this:
Assume you have Standart(S) and Assistance(A) editor opened and you want swap them.
1) Double tap with holded Alt to line in navigation bar of S editor with file name (look screenshot). This file will open in A editor.
2) In A editor tap Go Back and do 1. File from A editor will be opened in S editor.
3) In A editor tap Go Forward.
DONE!

Resources