Last active
September 18, 2025 22:02
-
-
Save diek/205d7f5b668ed41d3b7756b3f8115b85 to your computer and use it in GitHub Desktop.
YAML Definition - Sublime Text
This file contains hidden or 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
| %YAML 1.2 | |
| --- | |
| name: YAML (Improved) | |
| file_extensions: | |
| - yml | |
| - yaml | |
| scope: source.yaml | |
| contexts: | |
| main: | |
| # Comments (line-start or inline) | |
| - match: '#.*$' | |
| scope: comment.line.number-sign.yaml | |
| # Boolean & null constants (only when the value is exactly the boolean) | |
| - match: ':\s*(true|false|null|yes|no|on|off)\s*$' | |
| scope: constant.language.boolean.yaml | |
| # Numbers (int, float, hex, scientific) | |
| - match: '\b(0[xX][0-9A-Fa-f]+|\d+(\.\d+)?([eE][+-]?\d+)?)\b' | |
| scope: constant.numeric.yaml | |
| # Document start/end markers | |
| - match: '([-]{3}|[.]{3})' | |
| scope: punctuation.definition.document.yaml | |
| # Anchors (&foo) and aliases (*foo) | |
| - match: '(&\w+)' | |
| scope: entity.name.anchor.yaml | |
| - match: '(\*\w+)' | |
| scope: variable.other.alias.yaml | |
| # Keys | |
| - match: '(\w+):' | |
| captures: | |
| 1: entity.name.tag.yaml | |
| # Include scalars (quoted strings etc.) | |
| - include: scalars | |
| # Embedded shell blocks | |
| - match: '^\s*(script|command|run):\s*\|' | |
| push: | |
| - meta_scope: source.yaml.embedded.bash | |
| - include: scope:source.shell | |
| - match: '^(?=\S)' | |
| pop: true | |
| scalars: | |
| - match: | | |
| "([^"\\]|\\.)*" | |
| scope: string.quoted.double.yaml | |
| - match: | | |
| '([^'\\]|\\.)*' | |
| scope: string.quoted.single.yaml |
Author
Author
Edit needed to differentiate text from comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A much better syntax highlighter for SBT yaml files