Created
December 1, 2014 00:05
-
-
Save wmertens/ee3da82fd179549875ac to your computer and use it in GitHub Desktop.
Nix syntax highlighting in TextMate format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>fileTypes</key> | |
<array> | |
<string>nix</string> | |
</array> | |
<key>name</key> | |
<string>Nix</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#expression</string> | |
</dict> | |
</array> | |
<key>repository</key> | |
<dict> | |
<key>attribute-bind</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>begin</key> | |
<string>\binherit\b</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.other.inherit.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>\;</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.terminator.inherit.nix</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>begin</key> | |
<string>\(</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.section.function.arguments.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>\)</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.section.function.arguments.nix</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#expression</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#attribute-name-single</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#whitespace</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#illegal</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#attribute-name</string> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>\=</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.operator.bind.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>\;</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.terminator.bind.nix</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#expression</string> | |
</dict> | |
</array> | |
</dict> | |
</array> | |
</dict> | |
<key>attribute-name</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>match</key> | |
<string>\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*</string> | |
<key>name</key> | |
<string>entity.other.attribute-name.multipart.nix</string> | |
</dict> | |
<dict> | |
<key>match</key> | |
<string>\.</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#string-quoted</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#interpolation</string> | |
</dict> | |
</array> | |
</dict> | |
<key>attribute-name-single</key> | |
<dict> | |
<key>match</key> | |
<string>\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*</string> | |
<key>name</key> | |
<string>entity.other.attribute-name.single.nix</string> | |
</dict> | |
<key>attrset-contents</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#whitespace</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#comment</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#attribute-bind</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#illegal</string> | |
</dict> | |
</array> | |
</dict> | |
<key>attrset-for-sure</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>match</key> | |
<string>\{\s*\}</string> | |
<key>name</key> | |
<string>punctuation.definition.attrset.nix</string> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>\b(rec|let)\s*(\{)</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.other.nix</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.attrset.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>\}</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.attrset.nix</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#attrset-contents</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>\{(?=[^,?]*=)</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.attrset.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>\}</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.attrset.nix</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#attrset-contents</string> | |
</dict> | |
</array> | |
</dict> | |
</array> | |
</dict> | |
<key>attrset-or-function</key> | |
<dict> | |
<key>begin</key> | |
<string>(\{)</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.attrset-or-function.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>\}(\s*:)?</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.attrset-or-function.nix</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#whitespace</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#comment</string> | |
</dict> | |
<dict> | |
<key>match</key> | |
<string>\,</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#optional-default</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#attribute-bind</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#function-parameter</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#illegal</string> | |
</dict> | |
</array> | |
</dict> | |
<key>comment</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>begin</key> | |
<string>/\*([^*]|\*[^\/])*</string> | |
<key>end</key> | |
<string>\*\/</string> | |
<key>name</key> | |
<string>comment.block.nix</string> | |
</dict> | |
<dict> | |
<key>match</key> | |
<string>\#.*</string> | |
<key>name</key> | |
<string>comment.line.number-sign.nix</string> | |
</dict> | |
</array> | |
</dict> | |
<key>expression</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#whitespace</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#comment</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#parens</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#list</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#string</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#with-assert</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#function-for-sure</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#attrset-for-sure</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#attrset-or-function</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#let</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#if</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#interpolation</string> | |
</dict> | |
<dict> | |
<key>match</key> | |
<string>(\bor\b|\.|==|!=|!|\<\=|\<|\>\=|\>|&&|\|\||-\>|//|\?|\+\+|-|\*|/|\+)</string> | |
<key>name</key> | |
<string>keyword.operator.nix</string> | |
</dict> | |
<dict> | |
<key>match</key> | |
<string>\b(builtins|true|false|null)\b</string> | |
<key>name</key> | |
<string>constant.language.nix</string> | |
</dict> | |
<dict> | |
<key>match</key> | |
<string>\b(scopedImport|import|isNull|abort|throw|baseNameOf|dirOf|removeAttrs|map|toString|derivationStrict|derivation)\b</string> | |
<key>name</key> | |
<string>support.function.nix</string> | |
</dict> | |
<dict> | |
<key>match</key> | |
<string>\b[0-9]+\b</string> | |
<key>name</key> | |
<string>constant.numeric.nix</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#parameter-name</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#illegal</string> | |
</dict> | |
</array> | |
</dict> | |
<key>function-contents</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#whitespace</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#comment</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#function-parameter</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#illegal</string> | |
</dict> | |
</array> | |
</dict> | |
<key>function-for-sure</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>captures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>variable.parameter.nix</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.entity.function.1.nix</string> | |
</dict> | |
</dict> | |
<key>match</key> | |
<string>(\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*)\s*(:)</string> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(\{)(?=[^}]*\}\s*:)</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.entity.function.2.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\})\s*(@\s*([a-zA-Z\_][a-zA-Z0-9\_\'\-]*)\s*)?(:)</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.entity.function.nix</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.entity.function.nix</string> | |
</dict> | |
<key>3</key> | |
<dict> | |
<key>name</key> | |
<string>variable.parameter.nix</string> | |
</dict> | |
<key>5</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.entity.function.nix</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#function-contents</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>(\{)(?=[^#}"'/=]*[,\?])</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.entity.function.3.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\}\s*(@\s*([a-zA-Z\_][a-zA-Z0-9\_\'\-]*)\s*)?:)</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.entity.function.nix</string> | |
</dict> | |
<key>3</key> | |
<dict> | |
<key>name</key> | |
<string>variable.parameter.nix</string> | |
</dict> | |
<key>5</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.entity.function.nix</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#function-contents</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>((\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*)\s*@\s*)(\{)</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>3</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.entity.function.4.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(\}\s*(@\s*([a-zA-Z\_][a-zA-Z0-9\_\'\-]*)\s*)?:)</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.entity.function.nix</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#function-contents</string> | |
</dict> | |
</array> | |
</dict> | |
</array> | |
</dict> | |
<key>function-parameter</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>match</key> | |
<string>(\.\.\.)</string> | |
<key>name</key> | |
<string>keyword.operator.nix</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#optional-default</string> | |
</dict> | |
<dict> | |
<key>begin</key> | |
<string>\b([a-zA-Z\_][a-zA-Z0-9\_\'\-.]*)</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>variable.parameter.nix</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.operator.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(,|(?=\}))</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#whitespace</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#comment</string> | |
</dict> | |
</array> | |
</dict> | |
</array> | |
</dict> | |
<key>if</key> | |
<dict> | |
<key>begin</key> | |
<string>\bif\b</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.other.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>\belse\b</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.other.nix</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>match</key> | |
<string>\bthen\b</string> | |
<key>name</key> | |
<string>keyword.other.nix</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#expression</string> | |
</dict> | |
</array> | |
</dict> | |
<key>illegal</key> | |
<dict> | |
<key>match</key> | |
<string>.</string> | |
<key>name</key> | |
<string>invalid.illegal</string> | |
</dict> | |
<key>interpolation</key> | |
<dict> | |
<key>begin</key> | |
<string>\$\{</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>constant.character.begin.nix</string> | |
</dict> | |
</dict> | |
<key>contentName</key> | |
<string>string.interpolated.nix</string> | |
<key>end</key> | |
<string>\}</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>constant.character.end.nix</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>source.nix</string> | |
</dict> | |
</array> | |
</dict> | |
<key>let</key> | |
<dict> | |
<key>begin</key> | |
<string>\blet\b</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.other.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>\bin\b</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.other.nix</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#whitespace</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#comment</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#attribute-bind</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#illegal</string> | |
</dict> | |
</array> | |
</dict> | |
<key>list</key> | |
<dict> | |
<key>begin</key> | |
<string>\[</string> | |
<key>end</key> | |
<string>\]</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#expression</string> | |
</dict> | |
</array> | |
</dict> | |
<key>optional-default</key> | |
<dict> | |
<key>begin</key> | |
<string>\b([a-zA-Z\_][a-zA-Z0-9\_\'\-.]*)\s*(\?)</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>name</key> | |
<string>variable.parameter.nix</string> | |
</dict> | |
<key>2</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.operator.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>(,|(?=\}))</string> | |
<key>endCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.section.function.arguments.nix</string> | |
</dict> | |
</dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#expression</string> | |
</dict> | |
</array> | |
</dict> | |
<key>parameter-name</key> | |
<dict> | |
<key>match</key> | |
<string>\b[a-zA-Z\_][a-zA-Z0-9\_\'\-]*</string> | |
<key>name</key> | |
<string>variable.parameter.nix</string> | |
</dict> | |
<key>parens</key> | |
<dict> | |
<key>begin</key> | |
<string>\(</string> | |
<key>end</key> | |
<string>\)</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#expression</string> | |
</dict> | |
</array> | |
</dict> | |
<key>string</key> | |
<dict> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>begin</key> | |
<string>\'\'</string> | |
<key>end</key> | |
<string>\'\'(?!\$|\'|\\.)</string> | |
<key>name</key> | |
<string>string.quoted.other.nix</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>match</key> | |
<string>\'\'(\$|\'|\\.)</string> | |
<key>name</key> | |
<string>constant.character.escape.nix</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#interpolation</string> | |
</dict> | |
</array> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#string-quoted</string> | |
</dict> | |
<dict> | |
<key>match</key> | |
<string>([a-zA-Z0-9\.\_\-\+]*(\/[a-zA-Z0-9\.\_\-\+]+)+)</string> | |
<key>name</key> | |
<string>string.unquoted.path.nix</string> | |
</dict> | |
<dict> | |
<key>match</key> | |
<string>(\<[a-zA-Z0-9\.\_\-\+]+(\/[a-zA-Z0-9\.\_\-\+]+)*\>)</string> | |
<key>name</key> | |
<string>string.unquoted.spath.nix</string> | |
</dict> | |
<dict> | |
<key>match</key> | |
<string>([a-zA-Z][a-zA-Z0-9\+\-\.]*\:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']+)</string> | |
<key>name</key> | |
<string>string.unquoted.url.nix</string> | |
</dict> | |
</array> | |
</dict> | |
<key>string-quoted</key> | |
<dict> | |
<key>begin</key> | |
<string>\"</string> | |
<key>end</key> | |
<string>\"</string> | |
<key>name</key> | |
<string>string.quoted.double.nix</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>match</key> | |
<string>\\.</string> | |
<key>name</key> | |
<string>constant.character.escape.nix</string> | |
</dict> | |
<dict> | |
<key>include</key> | |
<string>#interpolation</string> | |
</dict> | |
</array> | |
</dict> | |
<key>whitespace</key> | |
<dict> | |
<key>match</key> | |
<string>\s+</string> | |
</dict> | |
<key>with-assert</key> | |
<dict> | |
<key>begin</key> | |
<string>\b(with|assert)\b</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>keyword.other.nix</string> | |
</dict> | |
</dict> | |
<key>end</key> | |
<string>\;</string> | |
<key>patterns</key> | |
<array> | |
<dict> | |
<key>include</key> | |
<string>#expression</string> | |
</dict> | |
</array> | |
</dict> | |
</dict> | |
<key>scopeName</key> | |
<string>source.nix</string> | |
<key>uuid</key> | |
<string>0514fd5f-acb6-436d-b42c-7643e6d36c8f</string> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See also https://gist.github.com/wmertens/9f0f1db0e91bc5e3e430