'phpstorm on osx: shortcut for 'Comment with Line Comment'

seems like i still didn't fully transform into a mac user (coming from Windows), once again having trouble with the keyboard shortcuts:

in phpstorm the following shortcut for 'Comment with Line Comment' is shown in the dropdown menu:

comment shortcut

now, problem being, there is no '/' key on my keyboard, typing a slash means pressing 'SHIFT+7' for me.

i already found the keymap options on phpstorm (currently using 'Mac OS X 10.5+) and tried changing the shortcut there but didn't get anywhere so far.

UPDATE 27. Sep. 2018



Solution 1:[1]

You can use the comment shortcut without editing the keymap. Just press on "=" button, on the right of the ":" button when doing your shorcut.

You can validate this behavior in the keymap editor: pressing the ":" button will show you the "." caracter instead.

But there's still a wrong keyboard mapping.

Solution 2:[2]

enter image description here

damn muricans! wait, JetBrains is located in CZ, damn czechs! ;)

Solution 3:[3]

as mentioned in my comment above, i managed to create my own shortcut by editing the keymap options. the thing i didn't understand in the 'add keyboard shortcut' dialog was that i thought i'm expected to press only one button when the 'First Stroke' textfield has focus.

i'd still be interested though why the default shortcut is something i can't even type on my keyboard?

Solution 4:[4]

I use two tricks to work around what I guess is a bug.

  • Ctl + Maj + A, then typing "comment" is enough to choose "Comment with Line comment" with the "Return" key.

  • Using the caps lock, that will let the Cmd + / work as expected

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pierre Marichez
Solution 2 ROLO
Solution 3 schellmax
Solution 4 Heah