Shortcut for commenting is folding the code instead of commenting

Answered

I'm using IDEA 2017.1.1, Fedora 25, Gnome. I'm using default key map settings. But when I press shortcut for commenting (Ctrl + /) - it doesn't comment the code. It folds the block of code instead. Checked the key map settings - Ctrl + . is used for folding and Ctrl + / for commenting.

How can I fix it to have default shortcut for commenting?

Below are the screenshots with the settings.

0
9 comments

Try to remap the actions to different shortcuts, see how IDE recognizes the keys you press.

0

Hi Serge,

So I tried to reassign the comment shortcut to Ctrl+Alt+Shift+/, but IDEA recognised the / key as a period:

 

Is it related to IDEA or to OS?

0

It depends on the OS and JDK version used to run IntelliJ IDEA.

See https://youtrack.jetbrains.com/issue/IDEA-165950 for details.

0

Didn't quite understand the discussion in that thread. Is it an open issue in the current stable build of IDEA?

0

it looks like problem is back. Probably starting with jidea 2023.1, however still present in IntelliJ IDEA 2023.2.2 (Ultimate Edition)

0
Do you have "Use national layout for shortcuts" option enabled in the Keymap settings? See also https://www.jetbrains.com/help/idea/settings-keymap.html#other .
0

Had the same problem on PHPStorm 2023.3.3. Enabling the “Use national layout for shortcuts” fixed it.

0

This issue came up using the following configuration:

  • Windows 11
  • WSL2, running Ubuntu
  • Pycharm 2025
  • Keyboard with Norwegian layout
  • Windows keyboard layout set to English (ENG)

Toggling “Use national layouts for shortcuts” to checked fixed the issue.

1

Please sign in to leave a comment.