Chad
Chad

Reputation: 1818

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?

Upvotes: 7

Views: 3198

Answers (2)

Roland Deschain
Roland Deschain

Reputation: 41

Update 02/2024 - PhpStorm 2023.3.3

File > Settings > Editor > Code Style > {Language} > Code Generation > Line comment at first column

Upvotes: 4

sareed
sareed

Reputation: 780

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.

Upvotes: 31

Related Questions