intellij-ideaidekeyboard-shortcuts

How to configure IntelliJ IDEA comment shortcut to not go to next line?


IntelliJ IDEA's keyboard shortcut for commenting, Ctrl+/, moves the cursor to the next line after it comments out the line. Is it possible to configure it so that it stays on the same line?


Solution

  • Go to File -> Settings -> Advanced Settings, and toggle Move caret down after Comment with Line Comment action in the Editor section

    Source: https://youtrack.jetbrains.com/issue/IJPL-52525/Line-comment-shortcut-without-jumping-to-new-line#focus=Comments-27-5579465.0-0