Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

  • Just found this blog post, help with the mapping on german mac laptop keyboards: https://victorvolle.wordpress.com/2012/05/16/intellij-german-keyboard-shortcuts-reference/

  • Also found out that I have a '/' character on the numeric pad part of my german keyboard, an it seems to act like the '/' key on english keyboards, so can use for the 'Comment with line Comment' shortcut ⌘/

like image 619
schellmax Avatar asked Mar 08 '13 07:03

schellmax


People also ask

How do I comment in Phpstorm Mac?

Quickly comment/uncomment blocks and lines. In WebStorm, you can comment and uncomment blocks of code with Cmd+Shift+/ on macOS and Ctrl+Shift+/ on Windows/Linux.

How comment multiple lines Phpstorm?

From the main menu, select Code | Comment with Block Comment. Press Ctrl+Shift+/ .

How do you comment multiple lines on a Mac?

On Mac, you search for ⌘ Cmd + Shift + C . The shortcut generates multi line comments with // .

How do you comment a line in Mac terminal?

When using Mac OS X including iTerm, I can simply press Shift + $ and the line in bash that I am currently tiping will get a # added to the beginning and the line returns.


2 Answers

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.

like image 112
Pierre Marichez Avatar answered Dec 09 '22 13:12

Pierre Marichez


enter image description here

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

like image 38
ROLO Avatar answered Dec 09 '22 13:12

ROLO