highlights.scm

 1(comment) @comment
 2
 3[
 4  "if"
 5  "then"
 6  "else"
 7  "let"
 8  "inherit"
 9  "in"
10  "rec"
11  "with"
12  "assert"
13  "or"
14] @keyword
15
16[
17 (string_expression)
18 (indented_string_expression)
19] @string
20
21[
22  (path_expression)
23  (hpath_expression)
24  (spath_expression)
25] @string.special.path
26
27(uri_expression) @link_uri
28
29[
30  (integer_expression)
31  (float_expression)
32] @number
33
34(interpolation
35  "${" @punctuation.special
36  "}" @punctuation.special) @embedded
37
38(escape_sequence) @escape
39(dollar_escape) @escape
40
41(function_expression
42  universal: (identifier) @parameter
43)
44
45(formal
46  name: (identifier) @parameter
47  "?"? @punctuation.delimiter)
48
49(select_expression
50  attrpath: (attrpath (identifier)) @property)
51
52(apply_expression
53  function: [
54    (variable_expression (identifier)) @function
55    (select_expression
56      attrpath: (attrpath
57        attr: (identifier) @function .))])
58
59(unary_expression
60  operator: _ @operator)
61
62(binary_expression
63  operator: _ @operator)
64
65(variable_expression (identifier) @variable)
66
67(binding
68  attrpath: (attrpath (identifier)) @property)
69
70"=" @operator
71
72[
73  ";"
74  "."
75  ","
76] @punctuation.delimiter
77
78[
79  "("
80  ")"
81  "["
82  "]"
83  "{"
84  "}"
85] @punctuation.bracket
86
87(identifier) @variable
88
89((identifier) @function.builtin
90  (#match? @function.builtin "^(__add|__addErrorContext|__all|__any|__appendContext|__attrNames|__attrValues|__bitAnd|__bitOr|__bitXor|__catAttrs|__compareVersions|__concatLists|__concatMap|__concatStringsSep|__deepSeq|__div|__elem|__elemAt|__fetchurl|__filter|__filterSource|__findFile|__foldl'|__fromJSON|__functionArgs|__genList|__genericClosure|__getAttr|__getContext|__getEnv|__hasAttr|__hasContext|__hashFile|__hashString|__head|__intersectAttrs|__isAttrs|__isBool|__isFloat|__isFunction|__isInt|__isList|__isPath|__isString|__langVersion|__length|__lessThan|__listToAttrs|__mapAttrs|__match|__mul|__parseDrvName|__partition|__path|__pathExists|__readDir|__readFile|__replaceStrings|__seq|__sort|__split|__splitVersion|__storePath|__stringLength|__sub|__substring|__tail|__toFile|__toJSON|__toPath|__toXML|__trace|__tryEval|__typeOf|__unsafeDiscardOutputDependency|__unsafeDiscardStringContext|__unsafeGetAttrPos|__valueSize|abort|baseNameOf|derivation|derivationStrict|dirOf|fetchGit|fetchMercurial|fetchTarball|fromTOML|import|isNull|map|placeholder|removeAttrs|scopedImport|throw|toString)$")
91  (#is-not? local))
92
93((identifier) @variable.builtin
94 (#match? @variable.builtin "^(__currentSystem|__currentTime|__nixPath|__nixVersion|__storeDir|builtins|false|null|true)$")
95 (#is-not? local))