syntax: yaml: colorize the two known directives

See https://yaml.org/spec/1.2.2/#68-directives.

Also, recognize a Yaml file from a %YAML directive on the first line.
master
Benno Schulenberg 2021-10-03 10:09:28 +02:00
parent bb8f40989f
commit f545735638
1 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,7 @@
## License: GPL version 3 or newer
syntax yaml "\.ya?ml$"
header "^---( |$)"
header "^%YAML |^---( |$)"
tabgives " "
comment "#"
@ -26,7 +26,8 @@ color lightmagenta "("([^"]|\\")+"|'[^']+')"
color pink " [&*](\w|-)+( |$)"
# Symbols:
color bold,lagoon "^(---|\.\.\.)( |$)" " [|>]([1-9]?[+-]|[+-][1-9]?)?$"
color bold,lagoon "^(%YAML +[1-9]\.[0-9]$|%TAG |(---|\.\.\.)( |$))"
color bold,lagoon " [|>]([1-9]?[+-]|[+-][1-9]?)?$"
color bold,yellow "^ *(\?|([?:] +)?-) "
color yellow "[]{}[]"
color normal "^ *: "