Partially harmonizing the syntax-colouring files.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4899 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2014-05-16 20:21:34 +00:00
parent 1028d65aa9
commit fe9da9425e
30 changed files with 141 additions and 122 deletions

View File

@ -3,6 +3,7 @@
* doc/syntax/patch.nanorc: Show trailing whitespace on added lines. * doc/syntax/patch.nanorc: Show trailing whitespace on added lines.
* doc/syntax/debian.nanorc: Make the component colouring simpler, * doc/syntax/debian.nanorc: Make the component colouring simpler,
and the URI colouring completer, and improve the comments. and the URI colouring completer, and improve the comments.
* doc/syntax/*.nanorc: Harmonize (partially) the syntax files.
2014-05-16 David Lawrence Ramsey <pooka109@gmail.com> 2014-05-16 David Lawrence Ramsey <pooka109@gmail.com>
* src/color.c, src/cut.c, src/text.c: Tweak some whitespace. * src/color.c, src/cut.c, src/text.c: Tweak some whitespace.

View File

@ -1,18 +1,23 @@
## Here is an example for assembler. ## Here is an example for assembler.
##
syntax "asm" "\.(S|s|asm)$" syntax "asm" "\.(S|s|asm)$"
magic "[Aa]ssembl(y|er)" magic "[Aa]ssembl(y|er)"
color red "\<[A-Z_]{2,}\>" color red "\<[A-Z_]{2,}\>"
color brightgreen "\.(data|subsection|text)" color brightgreen "\.(data|subsection|text)"
color green "\.(align|file|globl|global|hidden|section|size|type|weak)" color green "\.(align|file|globl|global|hidden|section|size|type|weak)"
color brightyellow "\.(ascii|asciz|byte|double|float|hword|int|long|short|single|struct|word)" color brightyellow "\.(ascii|asciz|byte|double|float|hword|int|long|short|single|struct|word)"
icolor brightred "^[[:space:]]*[.0-9A-Z_]*:" icolor brightred "^[[:space:]]*[.0-9A-Z_]*:"
color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)" color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
## Highlight strings (note: VERY resource intensive)
# Strings.
color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
# Multiline strings (note: VERY resource intensive).
color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*"" color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
## Highlight comments
# Comments.
color brightblue "//.*" color brightblue "//.*"
color brightblue start="/\*" end="\*/" color brightblue start="/\*" end="\*/"
## Highlight trailing whitespace
# Trailing whitespace.
color ,green "[[:space:]]+$" color ,green "[[:space:]]+$"

View File

@ -1,24 +1,25 @@
## Here is an example for awk. ## Here is an example for awk.
##
syntax "awk" "\.awk$" syntax "awk" "\.awk$"
magic "awk.*script text" magic "awk.*script text"
## records
# Records.
icolor brightred "\$[0-9A-Z_!@#$*?-]+" icolor brightred "\$[0-9A-Z_!@#$*?-]+"
## awk-set variables # Awk-set variables.
color red "\<(ARGC|ARGIND|ARGV|BINMODE|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS)\>" color red "\<(ARGC|ARGIND|ARGV|BINMODE|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS)\>"
color red "\<(FILENAME|FNR|FS|IGNORECASE|LINT|NF|NR|OFMT|OFS|ORS)\>" color red "\<(FILENAME|FNR|FS|IGNORECASE|LINT|NF|NR|OFMT|OFS|ORS)\>"
color red "\<(PROCINFO|RS|RT|RSTART|RLENGTH|SUBSEP|TEXTDOMAIN)\>" color red "\<(PROCINFO|RS|RT|RSTART|RLENGTH|SUBSEP|TEXTDOMAIN)\>"
## function declarations and special patterns # Function declarations and special patterns.
color brightgreen "\<(function|extension|BEGIN|END)\>" color brightgreen "\<(function|extension|BEGIN|END)\>"
## operators # Operators.
color green "(\{|\}|\(|\)|\;|\]|\[|\\|<|>|!|=|&|\+|-|\*|%|/|\?:|\^|\|)" color green "(\{|\}|\(|\)|\;|\]|\[|\\|<|>|!|=|&|\+|-|\*|%|/|\?:|\^|\|)"
## flow control # Flow control.
color brightyellow "\<(for|if|while|do|else|in|delete|exit)\>" color brightyellow "\<(for|if|while|do|else|in|delete|exit)\>"
color brightyellow "\<(break|continue|return)\>" color brightyellow "\<(break|continue|return)\>"
## I/O statements # I/O statements.
color brightgreen "\<(close|getline|next|nextfile|print|printf)\>" color brightgreen "\<(close|getline|next|nextfile|print|printf)\>"
color brightgreen "\<(system|fflush)\>" color brightgreen "\<(system|fflush)\>"
## standard functions # Standard functions.
color magenta "\<(atan2|cos|exp|int|log|rand|sin|sqrt|srand)\>" color magenta "\<(atan2|cos|exp|int|log|rand|sin|sqrt|srand)\>"
color magenta "\<(asort|asorti|gensub|gsub|index|length|match)\>" color magenta "\<(asort|asorti|gensub|gsub|index|length|match)\>"
color magenta "\<(split|sprintf|strtonum|sub|substr|tolower|toupper)\>" color magenta "\<(split|sprintf|strtonum|sub|substr|tolower|toupper)\>"
@ -26,13 +27,10 @@ color magenta "\<(mktime|strftime|systime)\>"
color magenta "\<(and|compl|lshift|or|rshift|xor)\>" color magenta "\<(and|compl|lshift|or|rshift|xor)\>"
color magenta "\<(bindtextdomain|dcgettext|dcngettext)\>" color magenta "\<(bindtextdomain|dcgettext|dcngettext)\>"
## String highlighting. You will in general want your comments and # Strings.
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in.
color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
# Comments.
## Comment highlighting
color brightblue "(^|[[:space:]])#.*$" color brightblue "(^|[[:space:]])#.*$"
## Trailing whitespace # Trailing whitespace.
color ,green "[[:space:]]+$" color ,green "[[:space:]]+$"

View File

@ -1,5 +1,5 @@
## Colouring for Changelogs. ## Colouring for Changelogs.
##
syntax "changelog" "Change[Ll]og.*" syntax "changelog" "Change[Ll]og.*"
# Author lines. # Author lines.
@ -14,13 +14,10 @@ color magenta "[[:space:]]\*[[:space:]].*:"
# Command-line options. # Command-line options.
color cyan "[[:space:]]-[a-zA-Z\$]" "--[8a-z-]+" color cyan "[[:space:]]-[a-zA-Z\$]" "--[8a-z-]+"
# Bug numbers. # Bug numbers.
color cyan "bug #[0-9]{5}" color cyan "bug #[0-9]{5}"
# Probable variables, for variety. # Probable variables, for variety.
color brightred "\<[A-Z_][0-9A-Z_]+\>" color brightred "\<[A-Z_][0-9A-Z_]+\>"
# Key sequences. # Key sequences.
color brightblue "\^[A-Z]" "\<M-." "\<F1?[0-9]" "(\^|M-)Space" color brightblue "\^[A-Z]" "\<M-." "\<F1?[0-9]" "(\^|M-)Space"

View File

@ -1,5 +1,5 @@
## Syntax highlighting for CMake files. ## Syntax highlighting for CMake files.
##
syntax "cmake" "(CMakeLists\.txt|\.cmake)$" syntax "cmake" "(CMakeLists\.txt|\.cmake)$"
icolor green "^[[:space:]]*[A-Z0-9_]+" icolor green "^[[:space:]]*[A-Z0-9_]+"

View File

@ -1,6 +1,7 @@
## Here is an example for CSS files. ## Here is an example for CSS files.
##
syntax "css" "\.css$" syntax "css" "\.css$"
color brightred "." color brightred "."
color brightyellow start="\{" end="\}" color brightyellow start="\{" end="\}"
color brightwhite start=":" end="([;^\{]|$)" color brightwhite start=":" end="([;^\{]|$)"

View File

@ -1,6 +1,7 @@
## Here is an example for Gentoo ebuilds/eclasses. ## Here is an example for Gentoo ebuilds/eclasses.
##
syntax "ebuild" "\.e(build|class)$" syntax "ebuild" "\.e(build|class)$"
## All the standard portage functions ## All the standard portage functions
color brightgreen "(^|\<default_)src_(unpack|prepare|configure|compile|install|test)\>" color brightgreen "(^|\<default_)src_(unpack|prepare|configure|compile|install|test)\>"
color brightgreen "^pkg_(config|nofetch|info|pretend|setup|(pre|post)(inst|rm))\>" color brightgreen "^pkg_(config|nofetch|info|pretend|setup|(pre|post)(inst|rm))\>"

View File

@ -1,5 +1,5 @@
## Here is an example for Go. ## Here is an example for Go.
##
syntax "go" "\.go$" syntax "go" "\.go$"
# Types. # Types.

View File

@ -1,24 +1,25 @@
## Here is an example for groff. ## Here is an example for groff.
##
syntax "groff" "\.m[ems]$" "\.rof" "\.tmac$" "^tmac." syntax "groff" "\.m[ems]$" "\.rof" "\.tmac$" "^tmac."
## The argument of .ds or .nr
# The argument of .ds or .nr
color cyan "^\.(ds|nr) [^[[:space:]]]*" color cyan "^\.(ds|nr) [^[[:space:]]]*"
## Single character escapes # Single-character escapes
color brightmagenta "\\." color brightmagenta "\\."
## Highlight the argument of \f or \s in the same color # The argument of \f or \s in the same color
color brightmagenta "\\f." "\\f\(.." "\\s(\+|\-)?[0-9]" color brightmagenta "\\f." "\\f\(.." "\\s(\+|\-)?[0-9]"
## Newlines # Newlines
color cyan "(\\|\\\\)n(.|\(..)" color cyan "(\\|\\\\)n(.|\(..)"
color cyan start="(\\|\\\\)n\[" end="]" color cyan start="(\\|\\\\)n\[" end="]"
## Requests # Requests
color brightgreen "^\.[[:space:]]*[^[[:space:]]]*" color brightgreen "^\.[[:space:]]*[^[[:space:]]]*"
## Comments # Comments
color yellow "^\.\\".*$" color yellow "^\.\\".*$"
## Strings # Strings
color green "(\\|\\\\)\*(.|\(..)" color green "(\\|\\\\)\*(.|\(..)"
color green start="(\\|\\\\)\*\[" end="]" color green start="(\\|\\\\)\*\[" end="]"
## Characters # Characters
color brightred "\\\(.." color brightred "\\\(.."
color brightred start="\\\[" end="]" color brightred start="\\\[" end="]"
## Macro arguments # Macro arguments
color brightcyan "\\\\\$[1-9]" color brightcyan "\\\\\$[1-9]"

View File

@ -1,7 +1,8 @@
## Here is a short example for HTML. ## Here is a short example for HTML.
##
syntax "html" "\.html?$" syntax "html" "\.html?$"
magic "HTML document text" magic "HTML document text"
color cyan start="<" end=">" color cyan start="<" end=">"
color red "&[^;[:space:]]*;" color red "&[^;[:space:]]*;"
color green ""(\\.|[^"])*"" color green ""(\\.|[^"])*""

View File

@ -1,7 +1,8 @@
## Here is an example for Java. ## Here is an example for Java.
##
syntax "java" "\.java$" syntax "java" "\.java$"
magic "Java " magic "Java "
color green "\<(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\>" color green "\<(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\>"
color red "\<(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\>" color red "\<(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\>"
color cyan "\<(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\>" color cyan "\<(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\>"

View File

@ -1,6 +1,7 @@
## Here is an example for Javascript. ## Here is an example for Javascript.
##
syntax "javascript" "\.js$" syntax "javascript" "\.js$"
color brightred "\<[A-Z_][0-9A-Z_]+\>" color brightred "\<[A-Z_][0-9A-Z_]+\>"
color green "\<(const|function|let|this|typeof|var|void)\>" color green "\<(const|function|let|this|typeof|var|void)\>"
color brightyellow "\<(for|if|while|with|do|else|case|default|switch)\>" color brightyellow "\<(for|if|while|with|do|else|case|default|switch)\>"
@ -8,14 +9,11 @@ color brightyellow "\<(export|try|throw|catch|new|delete)\>"
color magenta "\<(continue|break|return|yield)\>" color magenta "\<(continue|break|return|yield)\>"
color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'" color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
## String highlighting. You will in general want your comments and # Strings.
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in.
color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" "'(\\.|[^'])*'" color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" "'(\\.|[^'])*'"
# Comments.
## Comment highlighting
color brightblue "//.*" color brightblue "//.*"
color brightblue start="/\*" end="\*/" color brightblue start="/\*" end="\*/"
## Trailing whitespace # Trailing whitespace.
color ,green "[[:space:]]+$" color ,green "[[:space:]]+$"

View File

@ -1,17 +1,9 @@
############################################################################## ## Syntax highlighting for Lua.
# #
# Lua syntax highlighting for Nano. ## Author: Matthew Wild <mwild1 (at) gmail.com>
# ## License: GPL 3 or later
# Author: Matthew Wild <mwild1 (at) gmail.com> ## Version: 2011-05-05
# License: GPL 3 or later
#
# Version: 2011-05-05
#
# Notes: Originally based on Ruby syntax rc by Josef 'Jupp' Schugt
##############################################################################
# Automatically use for '.lua' files
syntax "lua" "\.lua$" syntax "lua" "\.lua$"
color brightwhite "\[\[.*\]\]" color brightwhite "\[\[.*\]\]"

View File

@ -1,11 +1,12 @@
## Syntax highlighting for Makefiles. ## Here is an example for Makefiles.
## (unattributed example from http://wiki.linuxhelp.net/)
syntax "makefile" "Makefile[^/]*$" syntax "makefile" "Makefile[^/]*$"
color red "[:=]" color red "[:=]"
color magenta "\<(if|ifeq|else|endif)\>" color magenta "\<(if|ifeq|else|endif)\>"
color blue "\$+[{(][a-zA-Z0-9_-]+[})]" color blue "\$+[{(][a-zA-Z0-9_-]+[})]"
color brightblue "^[^ ]+:" color brightblue "^[^ ]+:"
color green "#.*$" color green "#.*$"
## Trailing whitespace. ## Trailing whitespace.
color ,green "[[:space:]]+$" color ,green "[[:space:]]+$"

View File

@ -1,14 +1,17 @@
## Here is an example for manpages. ## Here is an example for manpages.
##
syntax "man" "\.[1-9]x?$" syntax "man" "\.[1-9]x?$"
magic "troff or preprocessor input text" magic "troff or preprocessor input text"
color green "\.(SH|SS|TH) .*$" color green "\.(SH|SS|TH) .*$"
color brightgreen "\.(SH|SS|TH) " "\.([HIT]P)" color brightgreen "\.(SH|SS|TH) " "\.([HIT]P)"
color brightred "\.(B[IR]?|I[BR]?|R[BI]|S[BM]) .*$" color brightred "\.(B[IR]?|I[BR]?|R[BI]|S[BM]) .*$"
color brightblue "\.(B[IR]?|I[BR]?|R[BI]|S[BM]) " "\.([LP]?P)$" color brightblue "\.(B[IR]?|I[BR]?|R[BI]|S[BM]) " "\.([LP]?P)$"
color magenta "\\f[BIPR]" color magenta "\\f[BIPR]"
color yellow "\.(br|DT|RS|RE|PD)" color yellow "\.(br|DT|RS|RE|PD)"
# Comments. # Comments.
color cyan "\.?\\\".*$" color cyan "\.?\\\".*$"
# Trailing whitespace. # Trailing whitespace.
color ,green "[[:space:]]+$" color ,green "[[:space:]]+$"

View File

@ -1,7 +1,8 @@
## Here is an example for Magicpoint presentations. ## Here is an example for Magicpoint presentations.
##
syntax "mgp" "\.mgp$" syntax "mgp" "\.mgp$"
header "^%include.*" header "^%include.*"
icolor green "^%[a-z].*$" icolor green "^%[a-z].*$"
color cyan "(^|[[:space:]])#.*$" color cyan "(^|[[:space:]])#.*$"
color cyan "(^|[[:space:]])%%.*$" color cyan "(^|[[:space:]])%%.*$"

View File

@ -1,4 +1,5 @@
## Here is an example for quoted emails (under e.g. mutt). ## Here is an example for quoted emails (under e.g. mutt).
##
syntax "mutt" syntax "mutt"
color green "^>.*" color green "^>.*"

View File

@ -1,8 +1,8 @@
## Here is an example for C/C++/Obj-C. ## Here is an example for C/C++/Obj-C.
##
syntax "m" "\.m$" syntax "m" "\.m$"
## Stuffs # Stuffs,
color brightwhite "\<[A-Z_][0-9A-Z_]+\>" color brightwhite "\<[A-Z_][0-9A-Z_]+\>"
color green "\<(float|double|BOOL|bool|char|int|short|long|id|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>" color green "\<(float|double|BOOL|bool|char|int|short|long|id|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>"
color green "\<[[:alpha:]_][[:alnum:]_]*_t\>" color green "\<[[:alpha:]_][[:alnum:]_]*_t\>"
@ -12,27 +12,28 @@ color brightgreen "\<(try|throw|catch|operator|new|delete)\>"
color brightgreen "\<(goto|continue|break|return)\>" color brightgreen "\<(goto|continue|break|return)\>"
color brightgreen "@\<(en(code|d)|i(mplementation|nterface)|selector)\>" color brightgreen "@\<(en(code|d)|i(mplementation|nterface)|selector)\>"
## GCC builtins # GCC builtins.
color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
## Selector/method # Selector/method.
color brightmagenta "(^|[[:space:]])\[.*[[:space:]].*\]" color brightmagenta "(^|[[:space:]])\[.*[[:space:]].*\]"
color white ":[[:alnum:]]*" color white ":[[:alnum:]]*"
color magenta "[[:alnum:]]*:" color magenta "[[:alnum:]]*:"
color white "\[[^][:space:]]*\]" color white "\[[^][:space:]]*\]"
## String highlighting. You will in general want your comments and # Strings.
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in.
color brightblack "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'" color brightblack "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
color brightblack "<[^= ]*>" ""(\\.|[^"])*"" color brightblack "<[^= ]*>" ""(\\.|[^"])*""
color brightblue "@"(\\.|[^"])*"" color brightblue "@"(\\.|[^"])*""
## This string is VERY resource intensive! # Multiline strings. This regex is VERY resource intensive!
## color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*"" ## color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
# Preprocessor commands.
color brightblue "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error)" color brightblue "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
## Comment highlighting # Comments.
color yellow "//.*" color yellow "//.*"
color yellow start="/\*" end="\*/" color yellow start="/\*" end="\*/"
# Trailing whitespace.  
color ,green "[[:space:]]+$"

View File

@ -1,6 +1,7 @@
## Syntax highlighting for OCaml. ## Syntax highlighting for OCaml.
syntax "ocaml" "\.mli?$" syntax "ocaml" "\.mli?$"
#uid #uid
color red "\<[A-Z][0-9a-z_]{2,}\>" color red "\<[A-Z][0-9a-z_]{2,}\>"
#declarations #declarations

View File

@ -1,4 +1,5 @@
## Here is an example for Perl. ## Here is an example for Perl.
syntax "perl" "\.p[lm]$" syntax "perl" "\.p[lm]$"
header "^#!.*/perl[-0-9._]*" header "^#!.*/perl[-0-9._]*"
magic "Perl script text" magic "Perl script text"

View File

@ -1,31 +1,31 @@
## Here is an example for PHP. ## Here is an example for PHP.
##
syntax "php" "\.php[2345s~]?$" syntax "php" "\.php[2345s~]?$"
magic "PHP script text" magic "PHP script text"
## php markings # PHP markings.
color brightgreen "(<\?(php)?|\?>)" color brightgreen "(<\?(php)?|\?>)"
## functions # Functions.
color white "\<[a-z_]*\(" color white "\<[a-z_]*\("
## types # Types.
color green "\<(var|float|global|double|bool|char|int|enum|const)\>" color green "\<(var|float|global|double|bool|char|int|enum|const)\>"
## structure # Structure.
color brightyellow "\<(class|new|private|public|function|for|foreach|if|while|do|else|elseif|case|default|switch)\>" color brightyellow "\<(class|new|private|public|function|for|foreach|if|while|do|else|elseif|case|default|switch)\>"
## control flow # Control flow.
color magenta "\<(goto|continue|break|return)\>" color magenta "\<(goto|continue|break|return)\>"
## strings # Strings.
color brightyellow "<[^= ]*>" ""(\.|[^"])*"" color brightyellow "<[^= ]*>" ""(\.|[^"])*""
## comments # Comments.
color brightblue "//.*" color brightblue "//.*"
color brightblue start="/\*" end="\*/" color brightblue start="/\*" end="\*/"
#color blue start="<" end=">" ##color blue start="<" end=">"
#color red "&[^;[[:space:]]]*;" ##color red "&[^;[[:space:]]]*;"
## trailing whitespace # Trailing whitespace.
color ,green "[[:space:]]+$" color ,green "[[:space:]]+$"

View File

@ -1,6 +1,7 @@
## Colouring for PO files. ## Colouring for PO files.
##
syntax "po" "\.pot?$" syntax "po" "\.pot?$"
# Comments. # Comments.
color green "^#.*$" color green "^#.*$"
color yellow "Copyright|\(C\)" color yellow "Copyright|\(C\)"

View File

@ -1,6 +1,7 @@
## Here is an example for POV-Ray. ## Here is an example for POV-Ray.
##
syntax "pov" "\.(pov|POV|povray|POVRAY)$" syntax "pov" "\.(pov|POV|povray|POVRAY)$"
color brightcyan "^[[:space:]]*#[[:space:]]*(declare)" color brightcyan "^[[:space:]]*#[[:space:]]*(declare)"
color brightyellow "\<(sphere|cylinder|translate|matrix|rotate|scale)\>" color brightyellow "\<(sphere|cylinder|translate|matrix|rotate|scale)\>"
color brightyellow "\<(orthographic|location|up|right|direction|clipped_by)\>" color brightyellow "\<(orthographic|location|up|right|direction|clipped_by)\>"
@ -10,6 +11,7 @@ color brightred "\<(light_source|background)\>"
color brightred "\<(fog|object|camera)\>" color brightred "\<(fog|object|camera)\>"
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)" color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
color brightmagenta "\<(union|group|subgroup)\>" color brightmagenta "\<(union|group|subgroup)\>"
## Comment highlighting
# Comments.
color brightblue "//.*" color brightblue "//.*"
color brightblue start="/\*" end="\*/" color brightblue start="/\*" end="\*/"

View File

@ -1,5 +1,5 @@
## Here is an example for Python. ## Here is an example for Python.
##
syntax "python" "\.py$" syntax "python" "\.py$"
header "^#!.*/python[-0-9._]*" header "^#!.*/python[-0-9._]*"

View File

@ -1,31 +1,32 @@
## Here is an example for Ruby. ## Here is an example for Ruby.
##
syntax "ruby" "\.rb$" syntax "ruby" "\.rb$"
header "^#!.*/ruby[-0-9._]*" header "^#!.*/ruby[-0-9._]*"
## Asciibetical list of reserved words
# Asciibetical list of reserved words.
color yellow "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\>" color yellow "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\>"
## Constants # Constants.
color brightblue "(\$|@|@@)?\<[A-Z]+[0-9A-Z_a-z]*" color brightblue "(\$|@|@@)?\<[A-Z]+[0-9A-Z_a-z]*"
## Ruby "symbols" # Ruby "symbols".
icolor magenta "([ ]|^):[0-9A-Z_]+\>" icolor magenta "([ ]|^):[0-9A-Z_]+\>"
## Some unique things we want to stand out # Some unique things we want to stand out.
color brightyellow "\<(__FILE__|__LINE__)\>" color brightyellow "\<(__FILE__|__LINE__)\>"
## Regular expressions # Regular expressions.
color brightmagenta "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*" color brightmagenta "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
## Shell command expansion is in `backticks` or like %x{this}. These are # Shell command expansion is in `backticks` or like %x{this}. These are
## "double-quotish" (to use a perlism). # "double-quotish" (to use a perlism).
color brightblue "`[^`]*`" "%x\{[^}]*\}" color brightblue "`[^`]*`" "%x\{[^}]*\}"
## Strings, double-quoted # Strings, double-quoted.
color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!" color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
## Expression substitution. These go inside double-quoted strings, # Expression substitution. These go inside double-quoted strings,
## "like #{this}". # "like #{this}".
color brightgreen "#\{[^}]*\}" color brightgreen "#\{[^}]*\}"
## Strings, single-quoted # Strings, single-quoted.
color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!" color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
## Comments # Comments.
color cyan "#[^{].*$" "#$" color cyan "#[^{].*$" "#$"
color brightcyan "##[^{].*$" "##$" color brightcyan "##[^{].*$" "##$"
## "Here" docs # "Here" docs.
color green start="<<-?'?EOT'?" end="^EOT" color green start="<<-?'?EOT'?" end="^EOT"
## Some common markers # Some common markers.
color brightcyan "(XXX|TODO|FIXME|\?\?\?)" color brightcyan "(XXX|TODO|FIXME|\?\?\?)"

View File

@ -1,8 +1,9 @@
## Here is an example for Bourne shell scripts. ## Here is an example for Bourne shell scripts.
##
syntax "sh" "\.sh$" syntax "sh" "\.sh$"
magic "(POSIX|Bourne.*) shell script text"
header "^#!.*/(ba|k|pdk)?sh[-0-9_]*" header "^#!.*/(ba|k|pdk)?sh[-0-9_]*"
magic "(POSIX|Bourne.*) shell script text"
icolor brightgreen "^[0-9A-Z_]+\(\)" icolor brightgreen "^[0-9A-Z_]+\(\)"
color green "\<(break|case|continue|do|done|elif|else|esac|exit|fi|for|function|if|in|read|return|select|shift|then|time|until|while)\>" color green "\<(break|case|continue|do|done|elif|else|esac|exit|fi|for|function|if|in|read|return|select|shift|then|time|until|while)\>"
color green "\<(declare|eval|exec|export|let|local)\>" color green "\<(declare|eval|exec|export|let|local)\>"
@ -10,10 +11,17 @@ color green "[{}():;|`$<>!=&\\]" "(\]|\[)"
color green "-[Ldefgruwx]\>" color green "-[Ldefgruwx]\>"
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>" color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
color brightblue "\<(awk|cat|cd|ch(grp|mod|own)|cp|echo|env|grep|install|ln|make|mkdir|mv|popd|printf|pushd|rm|rmdir|sed|set|tar|touch|umask|unset)\>" color brightblue "\<(awk|cat|cd|ch(grp|mod|own)|cp|echo|env|grep|install|ln|make|mkdir|mv|popd|printf|pushd|rm|rmdir|sed|set|tar|touch|umask|unset)\>"
# Basic variable names (no braces). # Basic variable names (no braces).
color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*" color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*"
# More complicated variable names; handles braces and replacements and arrays. # More complicated variable names; handles braces and replacements and arrays.
color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})" color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
# Comments.
color cyan "(^|[[:space:]])#.*$" color cyan "(^|[[:space:]])#.*$"
# Strings.
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'" color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
# Trailing whitespace.
color ,green "[[:space:]]+$" color ,green "[[:space:]]+$"

View File

@ -1,8 +1,8 @@
## Syntax highlighting for RPM spec files. ## Syntax highlighting for RPM spec files.
## Parts were taken from Kate's (KDE) syntax highlighting.
## Asterios Dramis
syntax "spec" "\.(spec$|spec\.*)" syntax "spec" "\.(spec$|spec\.*)"
# Main tags
# Main tags.
color brightblue "((Icon|ExclusiveOs|ExcludeOs)[[:space:]]*:)" color brightblue "((Icon|ExclusiveOs|ExcludeOs)[[:space:]]*:)"
color brightblue "((BuildArch|BuildArchitectures|ExclusiveArch|ExcludeArch)[[:space:]]*:)" color brightblue "((BuildArch|BuildArchitectures|ExclusiveArch|ExcludeArch)[[:space:]]*:)"
color brightblue "((Conflicts|Obsoletes|Provides|Requires|Requires\(.*\)|Enhances|Suggests|BuildConflicts|BuildRequires|Recommends|PreReq|Supplements)[[:space:]]*:)" color brightblue "((Conflicts|Obsoletes|Provides|Requires|Requires\(.*\)|Enhances|Suggests|BuildConflicts|BuildRequires|Recommends|PreReq|Supplements)[[:space:]]*:)"
@ -11,28 +11,29 @@ color brightblue "((AutoReq|AutoProv|AutoReqProv)[[:space:]]*:)"
color brightblue "((Copyright|License|Summary|Summary\(.*\)|Distribution|Vendor|Packager|Group|Source\d*|Patch\d*|BuildRoot|Prefix)[[:space:]]*:)" color brightblue "((Copyright|License|Summary|Summary\(.*\)|Distribution|Vendor|Packager|Group|Source\d*|Patch\d*|BuildRoot|Prefix)[[:space:]]*:)"
color brightblue "((Name|Version|Release|Url|URL)[[:space:]]*:)" color brightblue "((Name|Version|Release|Url|URL)[[:space:]]*:)"
color brightblue start="^Source" end=":" start="^Patch" end=":" color brightblue start="^Source" end=":" start="^Patch" end=":"
# Architectures # Architectures.
color brightred "(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppc|iseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x|s390|noarch)" color brightred "(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppc|iseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x|s390|noarch)"
# Architecture conditionals # Architecture conditionals.
color brightred "(ifarch|ifnarch)" color brightred "(ifarch|ifnarch)"
# OS conditionals # OS conditionals.
color brightred "(ifos|ifnos)" color brightred "(ifos|ifnos)"
# %* strings # %* strings.
color green "%([A-Z_a-z_0-9_]*)" color green "%([A-Z_a-z_0-9_]*)"
color magenta "%_([A-Z_a-z_0-9_]*)" color magenta "%_([A-Z_a-z_0-9_]*)"
color yellow start="%__" end="\ " color yellow start="%__" end="\ "
color magenta start="%\{" end="\}" color magenta start="%\{" end="\}"
color yellow start="%\{__" end="\}" color yellow start="%\{__" end="\}"
# Sections # Sections.
color red "^%(build$|changelog|check$|clean$|description|files|install$|package|pre|prep$|preun|post|postun)" color red "^%(build$|changelog|check$|clean$|description|files|install$|package|pre|prep$|preun|post|postun)"
color red "^%(trigger|triggerin|triggerpostun|triggerun|verifyscript)" color red "^%(trigger|triggerin|triggerpostun|triggerun|verifyscript)"
# Conditionals and Defines # Conditionals and defines.
color brightred "%(if|else|endif|define|global|undefine)" color brightred "%(if|else|endif|define|global|undefine)"
# Comments
# Comments.
color cyan "#.*$" color cyan "#.*$"
# "# norootforbuild" is handled as main tag # Special case: "# norootforbuild" is handled as main tag.
color brightblue "^# norootforbuild" color brightblue "^# norootforbuild"
# %changelog date entries # %changelog date entries.
color brightyellow "^\* .*\)$" color brightyellow "^\* .*\)$"
# Trailing whitespace # Trailing whitespace.
color ,green "[[:space:]]+$" color ,green "[[:space:]]+$"

View File

@ -1,6 +1,7 @@
## Here is a short example for TeX files. ## Here is a short example for TeX files.
##
syntax "tex" "\.tex$" syntax "tex" "\.tex$"
icolor green "\\.|\\[A-Z]*" icolor green "\\.|\\[A-Z]*"
color magenta "[{}]" color magenta "[{}]"
color blue "(^|[^\])%.*" color blue "(^|[^\])%.*"

View File

@ -1,5 +1,5 @@
## Here is an example for Texinfo files. ## Here is an example for Texinfo files.
##
syntax "texinfo" "\.texi$" syntax "texinfo" "\.texi$"
header "^\\input texinfo" header "^\\input texinfo"
magic "Texinfo source text" magic "Texinfo source text"