nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

yaml.nanorc (1368B)


      1 ## Syntax highlighting for YAML files.
      2 
      3 ## Original author:  Benno Schulenberg
      4 ## License:  GPL version 3 or newer
      5 
      6 syntax yaml "\.ya?ml$"
      7 header "^%YAML |^---( |$)"
      8 
      9 tabgives "  "
     10 comment "#"
     11 
     12 # Keys:
     13 color lightgreen "(\w|::|[/.-])+:( |$)"
     14 color lightgreen "\[(\w|::|[/., -])+\]:( |$)"
     15 
     16 # Values (booleans, numbers, octal/hex):
     17 color lightmagenta "[:,] +(Y(es)?|No?|y(es)?|no?|[Tt]rue|[Ff]alse|[Oo](n|ff))( *[]}]|, | +#|$)"
     18 color lightmagenta "[:,] +[+-]?[0-9]+(\.([0-9]+)?)?( *[]}]|, | +#|$)"
     19 color lightmagenta " 0(o[0-7]+|x[[:xdigit:]]+)( *[]}]|, | +#|$)"
     20 color normal "[:,]( |$)"
     21 # Values (dates, strings):
     22 color lightmagenta " [12][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])"
     23 color lightmagenta "("([^"]|\\")+"|'[^']+')"
     24 
     25 # Anchors and aliases:
     26 color pink " [&*](\w|-)+( |$)"
     27 
     28 # Symbols:
     29 color bold,lagoon "^(%YAML +[1-9]\.[0-9]$|%TAG |(---|\.\.\.)( |$))"
     30 color bold,lagoon " [|>]([1-9]?[+-]|[+-][1-9]?)?$"
     31 color bold,yellow "^ *(\?|([?:] +)?-) "
     32 color yellow "[]{}[]"
     33 color normal "^ *: "
     34 
     35 # Tags:
     36 color mint " !!(binary|bool|float|int|map|null|omap|seq|set|str)( |,|$)"
     37 color mint " ![^! 	][^ 	]*( |$)"
     38 
     39 # Escaped characters:
     40 color orange "\\([0abefnrtv"/ \_NLP]|$)"
     41 color orange "\\(x[[:xdigit:]]{2}|u[[:xdigit:]]{4}|U[[:xdigit:]]{8})"
     42 
     43 # Mistakes (control codes, trailing space):
     44 color ,red "[[:cntrl:]]| +$"
     45 
     46 # Comments:
     47 color italic,cyan "(^| )#.*"