Mercurial > repos > other > linux
annotate nanorc.d/php.nanorc @ 97:79a926514260
Use normal to undo "greater than" colouring
Note: won't work in older Nano (which will show "$var->…" with red >)
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 02 Apr 2018 19:50:12 +0100 |
parents | 67d3ac391320 |
children | c432b0708d6d |
rev | line source |
---|---|
85
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
1 ## Here is an example for PHP. |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
2 |
92
5f2c5800fa8a
Fix small differences with older Nano on the server
IBBoard <dev@ibboard.co.uk>
parents:
87
diff
changeset
|
3 syntax "php" "\.(php[23457s~]?|html?)$" |
85
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
4 magic "PHP script" |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
5 comment "//" |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
6 |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
7 # Types. |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
8 color cyan "\<(array|bool|callable|const|float|global|int|object|string|var)\>" |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
9 |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
10 # Directives and structure. |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
11 color cyan "\<(abstract|as|class|clone|(end)?declare|extends|function|implements|include(_once)?|inst(ance|ead)of|interface|namespace|new|private|protected|public|require(_once)?|static|trait|use|yield)\>" |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
12 color cyan "\<(case|catch|default|do|echo|else(if)?|end(for(each)?|if|switch|while)|final(ly)?|for(each)?|if|print|switch|throw|try|while)\>" |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
13 # Operators. |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
14 color red "&&|\|\||>=?|<=?|===?|!==?|!" |
97
79a926514260
Use normal to undo "greater than" colouring
IBBoard <dev@ibboard.co.uk>
parents:
96
diff
changeset
|
15 color normal "[-=]>" |
85
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
16 |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
17 color magenta "\$this" |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
18 |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
19 # Control flow. |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
20 color magenta "\<(break|continue|goto|return)\>" |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
21 |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
22 # Strings. |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
23 color yellow ""(\.|[^"])*"" "'(\.|[^'])*'" |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
24 |
86 | 25 # Numbers |
26 color blue "\b[0-9]+\b" | |
27 | |
85
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
28 # Comments. |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
29 color green "(^|[[:space:]]+)//.*" |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
30 color green start="/\*" end="\*/" |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
31 |
84 | 32 # General HTML |
86 | 33 color brightblue start="<[a-zA-Z/]" end=">" |
85
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
34 color red "&[^;[[:space:]]]*;" |
96
67d3ac391320
Reduce colouring for HTML/XML attributes
IBBoard <dev@ibboard.co.uk>
parents:
92
diff
changeset
|
35 color yellow "["'][^"']*["']" |
85
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
36 color green start="<!--" end="-->" |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
37 color white start="<!DOCTYPE" end=">" |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
38 # xhtml |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
39 color white start="<\?xml" end="\?>" |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
40 |
86 | 41 # PHP tags |
42 color brightblue "<\?(php|=)|\?>" | |
85
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
43 |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
44 # Trailing whitespace. |
ef08bb127ede
Ditch third-party nanorc configs and just add what we use
IBBoard <dev@ibboard.co.uk>
parents:
84
diff
changeset
|
45 color ,green "[[:space:]]+$" |