Add syntax highlighting for /etc/passwd file
commitedbb4b2fc9c631b295a8412855e035cc8f20a789
authorAnubhab Ghosh <anubhabghosh.me@gmail.com>
dateWed 23 Oct 2019, 23:55 (7 years ago)
parent15b1676
assets/syntaxes/Passwd.sublime-syntaxnew file+71
@@ -0,0 +1,71 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: passwd
5+file_extensions:
6+ - passwd
7+scope: source.passwd
8+
9+contexts:
10+ main:
11+ - comment: name
12+ match: ^[^:]+
13+ scope: keyword
14+
15+ - comment: password
16+ match: ":"
17+ push: password
18+
19+ password:
20+ - comment: uid
21+ match: ":"
22+ set: uid
23+
24+ - comment: shadowpassword
25+ match: "[^:]+"
26+ scope: invalid
27+
28+ uid:
29+ - comment: gid
30+ match: ":"
31+ set: gid
32+
33+ - comment: number
34+ match: "[0-9]+"
35+ scope: constant.numeric
36+
37+ gid:
38+ - comment: comment
39+ match: ":"
40+ set: comment
41+
42+ - comment: number
43+ match: "[0-9]+"
44+ scope: constant.language
45+
46+ comment:
47+ - comment: directory
48+ match: ":"
49+ set: directory
50+
51+ - comment: comment
52+ match: "[^:]+"
53+ scope: entity.name
54+
55+ directory:
56+ - comment: shell
57+ match: ":"
58+ set: shell
59+
60+ - comment: directory
61+ match: "[^:]+"
62+ scope: string.unquoted
63+
64+ shell:
65+ - comment: newline
66+ match: "\n"
67+ pop: true
68+
69+ - comment: directory
70+ match: "[^:\n]+"
71+ scope: variable.parameter