annotate nanorc.d/js.nanorc @ 84:b989099cde9f

Start to update Nano colourisation Defaults are REALLY basic
author IBBoard <dev@ibboard.co.uk>
date Sat, 31 Mar 2018 21:06:21 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
84
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 ### all *js files ( e.g. Firefox user.js, prefs.js )
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 ## Old version
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 #syntax "JavaScript" "(\.|/|)js$"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 #color green "//.*$" start="\/\*" end="\*\/"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 #color blue "'(\\.|[^'])*'"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 #color red ""(\\.|[^\"])*""
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 #color brightgreen "\<(true)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 #color brightred "\<(false)\>" "http\:\/\/.*$"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 #color brightmagenta "[0-9](\\.|[^\"])*)"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 ## New updated taken from http://wiki.linuxhelp.net/index.php/Nano_Syntax_Highlighting
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 syntax "JavaScript" "\.(js)$"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 ## Default
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 color white "^.+$"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 ## Decimal, cotal and hexadecimal numbers
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 color yellow "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 ## Floating point number with at least one digit before decimal point
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 color yellow "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25 color yellow "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27 ## Keywords
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 color green "\<(break|case|catch|continue|default|delete|do|else|finally)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 color green "\<(for|function|if|in|instanceof|new|null|return|switch)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30 color green "\<(switch|this|throw|try|typeof|undefined|var|void|while|with)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31 color green "\<(import|as|from|export)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 color green "\<const|let|class|extends|of|get|set|await|async|yield)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 ## Type specifiers
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 color red "\<(Array|Boolean|Date|Enumerator|Error|Function|Math)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
36 color red "\<(WeakMap|Map|WeakSet|Set|Symbol|Promise)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37 color red "\<(Number|Object|RegExp|String)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
38 color red "\<(true|false)\>"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
39
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
40 ## String
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
41 color brightyellow "L?\"(\\"|[^"])*\""
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
42 color brightyellow "L?'(\'|[^'])*'"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
43
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44 ## Trailing spaces
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
45 color ,green "[[:space:]]+$"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
46
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47 ## Escapes
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 color red "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
50 ## Comments
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
51 color brightblue start="/\*" end="\*/"
b989099cde9f Start to update Nano colourisation
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
52 color brightblue "//.*$"