Prevent closing of entire Xcode window on Command-W when "Quick Open" menu is open
Solution 1:
Here's how you unset the keyboard binding for Close Tab
aka ⌘
+W
.
- From Settings.app -> Keyboard -> Shortcuts -> App Shortcuts tap the
+
button - From
Application
dropdown selectXcode
- Enter
Close Tab
for theMenu Title
- set any keyboard shortcut you like
This un-maps ⌘
+W
shortcut in Xcode app completely. After this you are free to remap the ⌘
+W
key bindings in Xcode.
In my case I like ⌘
+W
to close the document so from Xcode -> Preference -> Key Bindings I have these changes (In your case you can bind Ctrl
+ ⌘
+W
to Close Tab
instead and leave Close Document
unmapped).