nano

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

json.nanorc (805B)


      1 ## Syntax highlighting for JSON files.
      2 
      3 ## Original author:  Aapo Rantalainen
      4 ## License:  GPL version 3 or newer
      5 
      6 syntax json "\.json$"
      7 # No comments are permitted in JSON.
      8 comment ""
      9 
     10 # Numbers (used as value).
     11 color green ":[[:blank:]]*\-?(0|[1-9][0-9]*)(\.[0-9]+)?([Ee]?[-+]?[0-9]+)?"
     12 # Values (well, any string).
     13 color brightmagenta "".+""
     14 # Hex numbers (used as value).
     15 color green ":[[:blank:]]*"#[[:xdigit:]]+""
     16 # Escapes.
     17 color green "\\(["\/bfnrt]|u[[:xdigit:]]{4})"
     18 # Special words.
     19 color green "\<(true|false|null)\>"
     20 
     21 # Names (very unlikely to contain a quote).
     22 color brightblue ""[^"]+"[[:blank:]]*:"
     23 
     24 # Brackets, braces, and separators.
     25 color brightblue "[][]"
     26 color brightred "[{},:]"
     27 
     28 # Comments.
     29 color cyan "(^|[[:blank:]]+)(//|#).*"
     30 
     31 # Trailing whitespace.
     32 color ,green "[[:space:]]+$"