Skip to content

Instantly share code, notes, and snippets.

@thejhh
Created August 27, 2011 02:25
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save thejhh/1174867 to your computer and use it in GitHub Desktop.
Save thejhh/1174867 to your computer and use it in GitHub Desktop.
Nanorc for javascript
## JavaScript
##
syntax "JS" "\.js$" "\.sjs$"
# Reserved Keywords
color yellow "\b(instanceof|typeof|break|do|new|var|case|else|return|void|catch|finally|continue|for|switch|while|this|with|debugger|function|throw|default|if|try|delete|in)\b"
# Future Reserved Words
color brightblue "\b(class|enum|extends|super|import|const|export|implements|let|private|public|yield|static|interface|package|protected)\b"
# Punctuators
color brightyellow "(\{|\}|\(|\)|\[|\]|\.|\;|\,|<|>|<=|===|\!==|>=|==|\!=|\+|\-|\*|\%|\+\+|\-\-|<<|>>|>>>|\&|\||\^|\!|\~|\&\&|\|\||\?|\:|=|\+=|\-=|\*=|\%=|<\=|>>=|>>>=|\&=|\|=|\^=|\/|\/=)"
# Literals
color yellow "\b(null|true|false|undefined)\b"
# Strings
color cyan "\"([^"]*|\\\")*\""
color cyan "'([^']*|\\')*'"
# Comments
color green "\s*//.*"
color brightgreen start="/\*" end="\*/"
# Mark non breaking space
color yellow,red " "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment