Skip to content
Browse files

Added JavaScript rc

  • Loading branch information...
1 parent 3874a5d commit a3ff41fbd205f9bc4deeb236cd5b5016c4e64053 @scopatz committed Jun 13, 2012
Showing with 46 additions and 0 deletions.
  1. +46 −0 js.nanorc
View
46 js.nanorc
@@ -0,0 +1,46 @@
+### all *js files ( e.g. Firefox user.js, prefs.js )
+
+## Old version
+
+#syntax "jsfiles" "(\.|/|)js$"
+#color green "//.*$" start="\/\*" end="\*\/"
+#color blue "'(\\.|[^'])*'"
+#color red ""(\\.|[^\"])*""
+#color brightgreen "\<(true)\>"
+#color brightred "\<(false)\>" "http\:\/\/.*$"
+#color brightmagenta "[0-9](\\.|[^\"])*)"
+
+## New updated taken from http://wiki.linuxhelp.net/index.php/Nano_Syntax_Highlighting
+
+syntax "JavaScript" "\.(js)$"
+
+## Default
+color white "^.+$"
+
+## Decimal, cotal and hexadecimal numbers
+color yellow "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>"
+
+## Floating point number with at least one digit before decimal point
+color yellow "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
+color yellow "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
+
+## Keywords
+color green "\<(break|case|catch|continue|default|delete|do|else|finally)\>"
+color green "\<(for|function|if|in|instanceof|new|null|return|switch)\>"
+color green "\<(switch|this|throw|try|typeof|undefined|var|void|while|with)\>"
+
+## Type specifiers
+color red "\<(Array|Boolean|Date|Enumerator|Error|Function|Math)\>"
+color red "\<(Number|Object|RegExp|String)\>"
+color red "\<(true|false)\>"
+
+## String
+color brightyellow "L?\"(\\"|[^"])*\""
+color brightyellow "L?'(\'|[^'])*'"
+
+## Escapes
+color red "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
+
+## Comments
+color brightblue start="/\*" end="\*/"
+color brightblue "//.*$"

0 comments on commit a3ff41f

Please sign in to comment.
Something went wrong with that request. Please try again.