Meet Ios Developer
Meet Ios Developer

Reputation: 170

How to edit greyed key bindings set in Xcode 11

I want to change the key binding set in Xcode 11 some are editable bur some are greyed which I cannot edit, how to unlock it.

enter image description here

Upvotes: 0

Views: 847

Answers (3)

Misguided Chunk
Misguided Chunk

Reputation: 417

You can change them! Here's what you do:

  1. Open the file ~/Library/Developer/Xcode/UserData/KeyBindings/Default.idekeybindings
  2. Look for the the name of the binding you want to change.
  3. Change the value inside of the <string> tag underneath the <key> with value <Alternate> from YES to NO
  4. Close and open Xcode
  5. Navigate to keybindings, then change your newly, not-greyed-out binding to whatever you want!

Upvotes: 2

bendytree
bendytree

Reputation: 13629

To be clear, you cannot edit key bindings that are grayed out. They are generated based on the preceding setting. For example, if the preceding settings is ⌘2 then the grayed out setting below may add to become ⌘⌥2.

If you're astonished at how poor this design is, then rest assured that your understanding is correct.

As a workaround, I use BetterTouchTool to remap my shortcuts. For example to "close other tabs" I remap ⌘⇧W (my preferred shortcut) to ⌥⌘W (Xcode's default) and have it only apply to the Xcode app.

Upvotes: 1

wzso
wzso

Reputation: 3905

Because they are similar to other editable shortcuts thus are treated as something like dependent variables.

In the File Menu section for example, the Close Tab (CMD+W) shortcut is editable. Meanwhile, the similar shortcuts (Close Other Tabs (Option+CMD+W), Close Window (Shift+CMD+W), Close Other Windows (Control+Option+CMD+W), Close All Windows (Option+Shift+CMD+W)) are not editable (greyed).

But when I change Close Tab from (CMD+W) to (CMD+M), the W in the keys of all those similar shortcuts will be changed accordingly to M.

You can verify this on your computer.

Upvotes: 1

Related Questions