@@ -0,0 +1,88 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: DotENV
5+file_extensions:
6+ - .env
7+ - .envrc
8+ - .env.dist
9+ - .env.local
10+ - .env.sample
11+ - .env.example
12+ - .env.test
13+ - .env.test.local
14+ - .env.dev
15+ - .env.development
16+ - .env.development.local
17+ - .env.prod
18+ - .env.production
19+ - .env.production.local
20+ - .env.dusk.local
21+scope: source.env
22+contexts:
23+ main:
24+ - match: (#).*$\n?
25+ comment: "Comments - starts with #"
26+ scope: comment.line.number-sign.env
27+ captures:
28+ 1: punctuation.definition.comment.env
29+ - match: (\")
30+ comment: Strings (double)
31+ captures:
32+ 1: punctuation.definition.string.begin.env
33+ push:
34+ - meta_scope: string.quoted.double.env
35+ - match: (\")
36+ captures:
37+ 1: punctuation.definition.string.end
38+ pop: true
39+ - include: interpolation
40+ - include: variable
41+ - include: escape-characters
42+ - match: (\')
43+ comment: Strings (single)
44+ captures:
45+ 1: punctuation.definition.string.begin.env
46+ push:
47+ - meta_scope: string.quoted.single.env
48+ - match: (\')
49+ captures:
50+ 1: punctuation.definition.string.end
51+ pop: true
52+ - match: '(?<=[\w])\s?='
53+ comment: Assignment Operator
54+ scope: keyword.operator.assignment.env
55+ - match: '([\w]+)(?=\s?\=)'
56+ comment: Variable
57+ scope: variable.other.env
58+ - match: (?i)\s?(export)
59+ comment: Keywords
60+ scope: keyword.other.env
61+ - match: (?i)(?<=\=)\s?(true|false|null)
62+ comment: Constants
63+ scope: constant.language.env
64+ - match: '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b'
65+ comment: Numeric
66+ scope: constant.numeric.env
67+ escape-characters:
68+ - match: '\\[nrt\\\$\"\'']'
69+ scope: constant.character.escape.env
70+ interpolation:
71+ - match: '(\$\{|\{)'
72+ comment: 'Template Syntax: "foo ${bar} {$baz}"'
73+ captures:
74+ 1: string.interpolated.env keyword.other.template.begin.env
75+ push:
76+ - match: '(\})'
77+ captures:
78+ 1: string.interpolated.env keyword.other.template.end.env
79+ pop: true
80+ - match: '(?x)(\$+)?([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*?\b)'
81+ captures:
82+ 1: punctuation.definition.variable.env variable.other.env
83+ 2: variable.other.env
84+ variable:
85+ - match: '(?x)(\$+)([a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*?\b)'
86+ captures:
87+ 1: punctuation.definition.variable.env variable.other.env
88+ 2: variable.other.env