I have an Xcode window open with many tabs. I want to open a file through Quick Open (⇧⌘O).
When I decide to close the Quick Open menu and also close the current tab that I'm on, I'll press Esc to close the Quick Open menu, and then press ⌘W to close the tab. However, sometimes I make a mistake and press ⌘W on the Quick Open menu, which causes the entire Xcode window to close instead.
Is it possible to prevent this behaviour? Maybe prevent ⌘W from doing anything when Quick Open is open?
Best Answer
Here's how you unset the keyboard binding for
Close Tab
aka⌘
+W
.+
buttonApplication
dropdown selectXcode
Close Tab
for theMenu Title
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 bindCtrl
+⌘
+W
toClose Tab
instead and leaveClose Document
unmapped).