view nanorc.d/php.nanorc @ 85:ef08bb127ede

Ditch third-party nanorc configs and just add what we use Started to modify some of the stock configs
author IBBoard <dev@ibboard.co.uk>
date Mon, 02 Apr 2018 16:42:48 +0100
parents b989099cde9f
children 3f3f641d5a8b
line wrap: on
line source

## Here is an example for PHP.

syntax php "\.(php[23457s~]?|html?)$"
magic "PHP script"
comment "//"

# PHP code
color black start="<\?(php|=)?" end="\?>"
# PHP tags  
color brightblue "<\?(php|=)|\?>"


# Function names.
#color white "\<[A-Za-z_][A-Za-z_0-9]*\("
# Variable names.
#color cyan "\$[A-Za-z_][A-Za-z_0-9]*"

# Types.
color cyan "\<(array|bool|callable|const|float|global|int|object|string|var)\>"

# Directives and structure.
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)\>"
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)\>"
# Operators.
color red "&&|\|\||>=?|<=?|===?|!==?|!"
color black "[-=]>"

color magenta "\$this"

# Control flow.
color magenta "\<(break|continue|goto|return)\>"

# Strings.
color yellow ""(\.|[^"])*"" "'(\.|[^'])*'"

# Comments.
color green "(^|[[:space:]]+)//.*"
color green start="/\*" end="\*/"

# General HTML
color brightblue start="<[a-zA-Z/]" end="[^\?]>"
color red "&[^;[[:space:]]]*;"
color yellow "[a-zA-Z_-]+=["']?[^"']+["']"
color green start="<!--" end="-->"
color white start="<!DOCTYPE" end=">"
# xhtml
color white start="<\?xml" end="\?>"


# Trailing whitespace.
color ,green "[[:space:]]+$"