An Emacs mode for .env files that includes the following features:
- Support for common .env file syntax as described in examples/.
Possible enhancements to be implemented in the future (willing to accept pull requests):
- Either decide on (and document) reasonable subset (or superset) of syntax to support OR support multiple syntaxes (like sql-mode in Emacs) based on commonly used .env file parsers:
Contributions are welcome 😊.
-
Copy dotenv-mode.el to your load path.
-
Add the following to your init.el:
(require 'dotenv-mode) ; unless installed from a package (add-to-list 'auto-mode-alist '("\\.env\\..*\\'" . dotenv-mode)) ;; for optionally supporting additional file extensions such as `.env.test' with this major mode
Link to original gist (see first commit for original version).