Search code examples
commentsphpstorm

PhpStorm: Comment shortcut places slashes at beginning of line


When I use the comment shortcut (Ctrl + /) the slashes are placed at the beginning of the line, like this:

protected function before()
{
//    echo "(before) ";  
}

However I'd expect this behaviour:

protected function before()
{
    //echo "(before) ";  
}

How do I configure PhpStorm to use the latter approach?


Solution

    1. Settings/Preferences
    2. Editor | Code Style | PHP
    3. Other tab and uncheck Line comments at first column option

    enter image description here


    In modern versions it is now located at the Code Generation tab:

    enter image description here