XCode 14.0 comment shortcut not working anymore

Previously using ( ⌘ + / ) to comment a block is not working anymore...

Post not yet marked as solved Up vote post of eddysalzmann Down vote post of eddysalzmann
4.1k views

Replies

For some (unknown) reason, it has been changed to ⌘ + ;

You can revert it back by changing in Xcode preferences.

It depends on your keyboard layout : for Italian keyboard it is ⌘ + ´ may be linked to the position of a key on US keyboard ?

In my case ⌘+/ show the help Menu although I changed the shortcut for this case, anyone more with this case?

I can confirm that for italian keyboards it's ⌘ + ´, which is usually used in the rest of MacOs for switching between windows of the same app (except for Finder, which has been recently changed for no reason to ⌘ + <, making it cumbersome and unusable). This is so dumb I can't even comment (and I am not referring to code comments..)

I had the same problem after I installed Xcode 14.0. On my swiss keyboard / is obtained with the combination ⇧7.

I fixed it thus

  • in the new Ventura System Settings - Keyboard - Keyboard Shortcuts - App Shortcuts I unchecked All Applications - Show Help menu, no big loss since I can access it from the toolbar
  • Xcode - Settings - Keyboard Bindings, the checkbox Adapt to current keyboard was checked, and I left it checked
  • in Xcode - Settings - Keyboard Bindings - Editor Menu for Source Code I selected Structure - Comment Selection and recorded the combination ⇧⌘7
  • the recorded combination is displayed as ⇧⌘/
  • now the block comment toggle works in my Xcode editor

Crosscheck

  • I went back to the first step above, and checked All Applications - Show Help menu; this overrode immediately my settings in Xcode, so I left it unchecked.

HTH

That's worked for me! Thanks @rudifa!

Thanks @rudifa! That's worked for me Xcode 14.2.

(⌘ + ß) works for me -> German keyboard