nano

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

javascript.nanorc (850B)


      1 ## Syntax highlighting for Javascript.
      2 
      3 syntax javascript "\.m?js$"
      4 magic "JavaScript source"
      5 comment "//"
      6 
      7 # Declarational stuff.
      8 color green "\<(async|class|const|extends|function|let|this|typeof|var|void)\>"
      9 # Flow control and special keywords.
     10 color brightyellow "\<(do|while|if|else|switch|case|default|for|each|in|of|with)\>"
     11 color brightyellow "\<(await|export|import|throw|try|catch|finally|new|delete)\>"
     12 # "Exit" points.
     13 color magenta "\<(break|continue|return|yield)\>"
     14 
     15 # Octal/decimal and hexadecimal numbers.
     16 color cyan "\<([0-9]+|0x[[:xdigit:]]+)\>"
     17 # Special values.
     18 color cyan "\<(true|false|null|undefined)\>"
     19 
     20 # Strings.
     21 color brightmagenta ""([^"\]|\\.)*"|'([^'\]|\\.)*'|`([^`\]|\\.)*`"
     22 # Comments.
     23 color brightblue "(^|[[:blank:]])//.*"
     24 color brightblue start="/\*" end="\*/"
     25 
     26 # Trailing whitespace.
     27 color ,green "[[:space:]]+$"