Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to comment multiple lines in PhpStorm IDE?

I use PhpStorm to edit PHP files and configuration files for Apache. How to comment on the selected block and set the symbol comment? I want,for example,

   <Directory />         Options FollowSymLinks         AllowOverride None         Order deny,allow         Deny from all     </Directory> 

to

   #<Directory />    #    Options FollowSymLinks    #    AllowOverride None    #    Order deny,allow    #    Deny from all    #</Directory> 
like image 510
BILL Avatar asked Sep 13 '11 19:09

BILL


2 Answers

Select multiple lines and use the Comment with Line Comment (Ctrl+/ in the default keymap on Windows, can be changed in Settings | Keymap).

There is also Comment with Block Comment that works for file types that have special style comment for code blocks (not applicable for .htaccess).

like image 112
CrazyCoder Avatar answered Sep 21 '22 19:09

CrazyCoder


There are two possibilities (in cases where block of comment are available like php, json etc files)

First
Windows: Ctrl+/
Mac: +/

will produce

// comment 

Second
Windows: Ctrl+Shift+/
Mac: ++/

will produce

/* comment */ 
like image 45
Dawid D Avatar answered Sep 21 '22 19:09

Dawid D