简体   繁体   中英

How to edit .env files in PhpStorm?

I generated new .env file with copy .env.example .env command in PhpStorm terminal. Then created .env file then but I can't edit in PhpStorm. When I double clicked it's open external editor (Notepad++).

不变的文件类型

  1. Settings/Preferences | Editor | File Types
  2. Find Files Opened in Associated Application entry in the top list
  3. Remove associated entry for .env files from the bottom list (Registered Patterns).
  4. Re-associate such pattern with another (more appropriate) File Type (eg "Text Files" .. or whatever other format that would be)

There is a plugin for .env files. It also helps by autocompleting env() and getenv() functions. https://plugins.jetbrains.com/plugin/9525--env-files-support

Go to file -> settings -> Editor -> File Types -> Recognized file types and select the "Text" -> add some patterns

.evn
*.env
.evn.*
*.env.*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM