https://github.com/overleaf/vim-env-syntax
Vim syntax highlighting plugin for .env files
https://github.com/overleaf/vim-env-syntax
Last synced: 3 months ago
JSON representation
Vim syntax highlighting plugin for .env files
- Host: GitHub
- URL: https://github.com/overleaf/vim-env-syntax
- Owner: overleaf
- License: other
- Created: 2023-08-24T11:01:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-28T08:25:02.000Z (over 2 years ago)
- Last Synced: 2024-04-11T15:27:51.966Z (about 2 years ago)
- Language: Vim Script
- Size: 2.93 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-env-syntax
This plugin provides Vim syntax highlighting for `.env` files.
Usually, `.env` files are detected as filetype `sh`, because they look like
– and often are – valid shell code. However, there is a file type definition
of `.env` files that is much simpler. Tools following this definition, such as
`kubectl`, do not parse `.env` files like a shell would.¹ Instead, lines are
very simply split at the first equal sign to determine variable names and
values. No parsing of the values is performed, leading to, e.g., quote
characters becoming part of the literal variable values.
The `env.vim` syntax definition only highlights relevant syntax for this
use-case. Besides variable names and the first equal sign, it highlights
potential pitfalls (see the included `examples.env` file). It does not
highlight any other syntax that would otherwise be significant to a shell.
¹⁾ Cf. [Kubernetes docs](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#create-configmaps-from-files).