Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Supporting of syntax highlighting of .env

Tags:

webstorm

I am using WebStorm 2021.3.1.

There is a question on .env file, since it seems like it's not supporting the syntax highlighting, commenting etc. for .env, but it supports .env.* like .env.example.

How do I get .env supported? Below are screenshots for .env and .env.local

Below is screenshot for .env enter image description here

Below is screenshot for .env.local enter image description here

like image 764
william007 Avatar asked Nov 15 '25 03:11

william007


1 Answers

Go to Settings/Preferences | Editor | File Types, locate Text file type there. Based on your first screenshot you should have .env entry there.

  • If you have it: remove it and re-add it to the .env file file type where it should be in the first place.

  • If there is no such entry under Text, add .env pattern directly to the .env file file type. If such pattern is already assigned to some another file type then the IDE will give you a prompt asking to remove it from another file type.

How .env file file type should look by default:

enter image description here

like image 188
LazyOne Avatar answered Nov 17 '25 21:11

LazyOne



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!