SublimeText Syntax Highlighting support for Environment (.env) Files
I started using this package to avoid the SublieLinter-shellcheck package complaining about my .env
files, and I made some improvements to make it more similar to the Bash syntax highlighting. I've since worked out how to avoid the shellcheck conflict and keep using the Bash syntax highlighting instead of needing this package:
-
Configure ApplySyntax (Preferences -> Package Settings -> ApplySyntax -> Settings) with:
{ // ... "syntaxes": [ { "syntax": "ShellScript/Bash", "rules": [ { "file_path": ".*/\\.env(\\..+)*$" } ] } ] }
-
Configure SublimeLinter (Preferences -> Package Settings -> SublimeLinter -> Settings) with:
{ // ... "linters": { "shellcheck": { "excludes": [ "*/.env", "*/.env.*", ] } } }
- Make sure you already have Package Control installed.
- Choose Install Package from the Command Palette (
Ctrl+Shift+P
on Windows/Linux Or⇧⌘P
on OS X) - Select
DotENV
and hitEnter
- Clone the repo to your Packages folder.
- Activate by
Ctrl+Shift+P
and fuzzy searchsyntax dotenv
and hitEnter