webstorm

Supporting of syntax highlighting of .env


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


Solution

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

    How .env file file type should look by default:

    enter image description here