From edbb4b2fc9c631b295a8412855e035cc8f20a789 Mon Sep 17 00:00:00 2001 From: Anubhab Ghosh Date: Wed, 23 Oct 2019 23:55:09 +0530 Subject: [PATCH] Add syntax highlighting for /etc/passwd file --- assets/syntaxes/Passwd.sublime-syntax | 71 +++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 assets/syntaxes/Passwd.sublime-syntax diff --git a/assets/syntaxes/Passwd.sublime-syntax b/assets/syntaxes/Passwd.sublime-syntax new file mode 100644 index 00000000..674dc2a4 --- /dev/null +++ b/assets/syntaxes/Passwd.sublime-syntax @@ -0,0 +1,71 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: passwd +file_extensions: + - passwd +scope: source.passwd + +contexts: + main: + - comment: name + match: ^[^:]+ + scope: keyword + + - comment: password + match: ":" + push: password + + password: + - comment: uid + match: ":" + set: uid + + - comment: shadowpassword + match: "[^:]+" + scope: invalid + + uid: + - comment: gid + match: ":" + set: gid + + - comment: number + match: "[0-9]+" + scope: constant.numeric + + gid: + - comment: comment + match: ":" + set: comment + + - comment: number + match: "[0-9]+" + scope: constant.language + + comment: + - comment: directory + match: ":" + set: directory + + - comment: comment + match: "[^:]+" + scope: entity.name + + directory: + - comment: shell + match: ":" + set: shell + + - comment: directory + match: "[^:]+" + scope: string.unquoted + + shell: + - comment: newline + match: "\n" + pop: true + + - comment: directory + match: "[^:\n]+" + scope: variable.parameter