51

When I use the Cmd + Shift + / keyboard shortcut to comment/uncomment a block of code, the Help tab on the menu bar in IntelliJ also opens.

Does anyone know how to prevent this shortcut from opening the Help menu tab in IntelliJ 16.1.2? I am using the Mac OS X 10.5+ shortcuts.

Supun Wijerathne
  • 11,964
  • 10
  • 61
  • 87
PhillyStafford
  • 627
  • 1
  • 7
  • 18

4 Answers4

113

Remove or replace the Cmd + Shift + / shortcut in your mac. Apple menu-> System Preferences-> Keyboard -> Shortcuts.

ss

Supun Wijerathne
  • 11,964
  • 10
  • 61
  • 87
Bajal
  • 5,487
  • 3
  • 20
  • 25
9

Steps:

  1. Remove or replace the Cmd + Shift + / shortcut on your Mac (as mentioned by @Bajal)
  2. Add new Intellij shortcut Cmd + 7 for "Comment with Line Comment" (Preferences -> Keymap)

enter image description here

Peter Keller
  • 7,526
  • 2
  • 26
  • 29
  • You are a genius, basically is the same but for some reason intellij doesnt like command / which is bassically command shift 7 – nicoabie Mar 06 '21 at 17:34
2

I used this work around but it didn't fix the problem:

In IntelliJ, I went to Preferences -> Keymap and I searched for comment. It turns out that there are 3 different commands to comment/uncomment a block of code.

  1. Cmd + Shift + /
  2. Ctrl + Shift + /
  3. Cmd + Alt + /

My work around to prevent Cmd + Shift + / from opening the Help menu tab is to use one of the other keyboard shortcuts.

This doesn't answer my question fully so if anyone has any suggestion please let me know as I would prefer to use Cmd + Shift + /

Supun Wijerathne
  • 11,964
  • 10
  • 61
  • 87
PhillyStafford
  • 627
  • 1
  • 7
  • 18
1

I had the very same issue. The solution by Bajal helped, because the shortcut didn't trigger the help tab. But it didn't allow me to line comment my code.

So I had to add Shift + Cmd + 7 to the keymap. This is exactly the same as Cmd + /, but I had to add it anyway.

Julian
  • 181
  • 10