Search code examples
phpidephpstorm

How can I get PhpStorm to comment a line at the beginning of the text and not line?


In PhpStorm when you press "Cmd + /" it will comment the line beginning with // like so...

//      $numbers = explode(',', $numbers);

What I'd like it to do is to put the // at the beginning of the text so as to keep my indented code more readable like this...

        //$numbers = explode(',', $numbers);

Does anyone know a way to do this in PhpStorm?


Solution

  • I may have found what you want. File > Settings > Editor > Code Style > PHP (or whatever) > Other uncheck the 'Line comment at first column' box under Code Commenting. I am using v8.0.2 so might be slightly different for other versions. Let me know if that is what you were looking for.