diff --git a/ChangeLog b/ChangeLog index 3304a28aaba44bc78f222c24892046a48f12933c..1b549541e2dbb67ac5b5c3b35bc00366f985b0d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * doc/syntax/patch.nanorc: Show trailing whitespace on added lines. * doc/syntax/debian.nanorc: Make the component colouring simpler, 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> * src/color.c, src/cut.c, src/text.c: Tweak some whitespace. diff --git a/doc/syntax/asm.nanorc b/doc/syntax/asm.nanorc index 9d9276042bd0fe2ca249de8514a131b07a671352..4e2159155a941c94155bb3d39a157ccb5d765e80 100644 --- a/doc/syntax/asm.nanorc +++ b/doc/syntax/asm.nanorc @@ -1,18 +1,23 @@ ## Here is an example for assembler. -## + syntax "asm" "\.(S|s|asm)$" magic "[Aa]ssembl(y|er)" + color red "\<[A-Z_]{2,}\>" color brightgreen "\.(data|subsection|text)" 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)" icolor brightred "^[[:space:]]*[.0-9A-Z_]*:" color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)" -## Highlight strings (note: VERY resource intensive) + +# Strings. color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" +# Multiline strings (note: VERY resource intensive). color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*"" -## Highlight comments + +# Comments. color brightblue "//.*" color brightblue start="/\*" end="\*/" -## Highlight trailing whitespace + +# Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/doc/syntax/awk.nanorc b/doc/syntax/awk.nanorc index 48b3db11a1ac88e779c5a39f0f25777c7d42e43c..bfc6387cf9f32f17cb5058e84044470e62ceb45a 100644 --- a/doc/syntax/awk.nanorc +++ b/doc/syntax/awk.nanorc @@ -1,24 +1,25 @@ ## Here is an example for awk. -## + syntax "awk" "\.awk$" magic "awk.*script text" -## records + +# Records. icolor brightred "\$[0-9A-Z_!@#$*?-]+" -## awk-set variables +# Awk-set variables. color red "\<(ARGC|ARGIND|ARGV|BINMODE|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS)\>" color red "\<(FILENAME|FNR|FS|IGNORECASE|LINT|NF|NR|OFMT|OFS|ORS)\>" 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)\>" -## operators +# Operators. color green "(\{|\}|\(|\)|\;|\]|\[|\\|<|>|!|=|&|\+|-|\*|%|/|\?:|\^|\|)" -## flow control +# Flow control. color brightyellow "\<(for|if|while|do|else|in|delete|exit)\>" color brightyellow "\<(break|continue|return)\>" -## I/O statements +# I/O statements. color brightgreen "\<(close|getline|next|nextfile|print|printf)\>" color brightgreen "\<(system|fflush)\>" -## standard functions +# Standard functions. color magenta "\<(atan2|cos|exp|int|log|rand|sin|sqrt|srand)\>" color magenta "\<(asort|asorti|gensub|gsub|index|length|match)\>" 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 "\<(bindtextdomain|dcgettext|dcngettext)\>" -## String highlighting. You will in general want your comments and -## strings to come last, because syntax highlighting rules will be -## applied in the order they are read in. +# Strings. color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" - -## Comment highlighting +# Comments. color brightblue "(^|[[:space:]])#.*$" -## Trailing whitespace +# Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/doc/syntax/c.nanorc b/doc/syntax/c.nanorc index 3fc3fbb3f3ba7be0ef183c5657ad51cf738b55d6..8fe7088dcfc38353dc0b06b3e124c31af34be206 100644 --- a/doc/syntax/c.nanorc +++ b/doc/syntax/c.nanorc @@ -3,7 +3,7 @@ syntax "c" "\.(c(c|pp|xx|\+\+)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$" magic "(ASCII|UTF-8 Unicode) C(\+\+)? program text" -color brightred "\<[A-Z_][0-9A-Z_]+\>" +color brightred "\<[A-Z_][0-9A-Z_]+\>" color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|auto|static|const|struct|union|typedef|extern|(un)?signed|inline)\>" color green "\<((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\>" color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>" diff --git a/doc/syntax/changelog.nanorc b/doc/syntax/changelog.nanorc index 84c07b09086cb11af8b45ee1d5322f39aa978bea..60666bd519803dfee2d1073cdb81ef49493a43fd 100644 --- a/doc/syntax/changelog.nanorc +++ b/doc/syntax/changelog.nanorc @@ -1,5 +1,5 @@ ## Colouring for Changelogs. -## + syntax "changelog" "Change[Ll]og.*" # Author lines. @@ -14,13 +14,10 @@ color magenta "[[:space:]]\*[[:space:]].*:" # Command-line options. color cyan "[[:space:]]-[a-zA-Z\$]" "--[8a-z-]+" - # Bug numbers. color cyan "bug #[0-9]{5}" - # Probable variables, for variety. -color brightred "\<[A-Z_][0-9A-Z_]+\>" - +color brightred "\<[A-Z_][0-9A-Z_]+\>" # Key sequences. color brightblue "\^[A-Z]" "\<M-." "\<F1?[0-9]" "(\^|M-)Space" diff --git a/doc/syntax/cmake.nanorc b/doc/syntax/cmake.nanorc index 77a8a18c3648b66f3fac527e1996996850f7f6d6..dc4370249ae1ec3bcf576c2619729ece12021637 100644 --- a/doc/syntax/cmake.nanorc +++ b/doc/syntax/cmake.nanorc @@ -1,5 +1,5 @@ ## Syntax highlighting for CMake files. -## + syntax "cmake" "(CMakeLists\.txt|\.cmake)$" icolor green "^[[:space:]]*[A-Z0-9_]+" diff --git a/doc/syntax/css.nanorc b/doc/syntax/css.nanorc index 9347b13eee40df44e8e7156eb4f30b6a95de988d..a806d7c560ee33acea4bcaaf48e4054aafa2616a 100644 --- a/doc/syntax/css.nanorc +++ b/doc/syntax/css.nanorc @@ -1,6 +1,7 @@ ## Here is an example for CSS files. -## + syntax "css" "\.css$" + color brightred "." color brightyellow start="\{" end="\}" color brightwhite start=":" end="([;^\{]|$)" diff --git a/doc/syntax/gentoo.nanorc b/doc/syntax/gentoo.nanorc index 96bd18a01588c3c79e4c5a81ca0d2ddb06aa9a79..249e224d7e73e05e91088584d8499327cd9540d9 100644 --- a/doc/syntax/gentoo.nanorc +++ b/doc/syntax/gentoo.nanorc @@ -1,6 +1,7 @@ ## Here is an example for Gentoo ebuilds/eclasses. -## + syntax "ebuild" "\.e(build|class)$" + ## All the standard portage functions color brightgreen "(^|\<default_)src_(unpack|prepare|configure|compile|install|test)\>" color brightgreen "^pkg_(config|nofetch|info|pretend|setup|(pre|post)(inst|rm))\>" diff --git a/doc/syntax/go.nanorc b/doc/syntax/go.nanorc index b60c72f46fbfbbbd503f2998f6046b89d69a6569..58ef1812cb401b0f5a363c54f1940373cb535a46 100644 --- a/doc/syntax/go.nanorc +++ b/doc/syntax/go.nanorc @@ -1,5 +1,5 @@ ## Here is an example for Go. -## + syntax "go" "\.go$" # Types. diff --git a/doc/syntax/groff.nanorc b/doc/syntax/groff.nanorc index 02b82b8e4388fa5042531e6b058503edd22d7553..70f641d3197b4920a88af4b4efbdda1c752ae45a 100644 --- a/doc/syntax/groff.nanorc +++ b/doc/syntax/groff.nanorc @@ -1,24 +1,25 @@ ## Here is an example for groff. -## + syntax "groff" "\.m[ems]$" "\.rof" "\.tmac$" "^tmac." -## The argument of .ds or .nr + +# The argument of .ds or .nr color cyan "^\.(ds|nr) [^[[:space:]]]*" -## Single character escapes +# Single-character escapes 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]" -## Newlines +# Newlines color cyan "(\\|\\\\)n(.|\(..)" color cyan start="(\\|\\\\)n\[" end="]" -## Requests +# Requests color brightgreen "^\.[[:space:]]*[^[[:space:]]]*" -## Comments +# Comments color yellow "^\.\\".*$" -## Strings +# Strings color green "(\\|\\\\)\*(.|\(..)" color green start="(\\|\\\\)\*\[" end="]" -## Characters +# Characters color brightred "\\\(.." color brightred start="\\\[" end="]" -## Macro arguments +# Macro arguments color brightcyan "\\\\\$[1-9]" diff --git a/doc/syntax/html.nanorc b/doc/syntax/html.nanorc index 5066da445f7427b07cc9352a57237718ca2fd4f9..8782dc3642dc7b61e87bd3d2d540cbd250baf8cb 100644 --- a/doc/syntax/html.nanorc +++ b/doc/syntax/html.nanorc @@ -1,7 +1,8 @@ ## Here is a short example for HTML. -## + syntax "html" "\.html?$" magic "HTML document text" + color cyan start="<" end=">" color red "&[^;[:space:]]*;" color green ""(\\.|[^"])*"" diff --git a/doc/syntax/java.nanorc b/doc/syntax/java.nanorc index f45b0c94f69998ec908481852b1d78259a24467d..0beebf470749c3ef2161a4cb414f32315ca693d4 100644 --- a/doc/syntax/java.nanorc +++ b/doc/syntax/java.nanorc @@ -1,7 +1,8 @@ ## Here is an example for Java. -## + syntax "java" "\.java$" magic "Java " + 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 cyan "\<(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\>" diff --git a/doc/syntax/javascript.nanorc b/doc/syntax/javascript.nanorc index d68da5dd8e071e72788fc57e660671679d585bdf..991f54bf0ebf70381d2a999f63e23b6ae6f62e0d 100644 --- a/doc/syntax/javascript.nanorc +++ b/doc/syntax/javascript.nanorc @@ -1,6 +1,7 @@ ## Here is an example for Javascript. -## + syntax "javascript" "\.js$" + color brightred "\<[A-Z_][0-9A-Z_]+\>" color green "\<(const|function|let|this|typeof|var|void)\>" 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 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 to come last, because syntax highlighting rules will be -## applied in the order they are read in. +# Strings. color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" "'(\\.|[^'])*'" - -## Comment highlighting +# Comments. color brightblue "//.*" color brightblue start="/\*" end="\*/" -## Trailing whitespace +# Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/doc/syntax/lua.nanorc b/doc/syntax/lua.nanorc index 3f5b7be86c437a842ecc48bddcd1c59b2597674f..7512f53c4f659894cff47114f62e875bb3a8220e 100644 --- a/doc/syntax/lua.nanorc +++ b/doc/syntax/lua.nanorc @@ -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 -# -# Version: 2011-05-05 -# -# Notes: Originally based on Ruby syntax rc by Josef 'Jupp' Schugt -############################################################################## - +## Author: Matthew Wild <mwild1 (at) gmail.com> +## License: GPL 3 or later +## Version: 2011-05-05 -# Automatically use for '.lua' files syntax "lua" "\.lua$" color brightwhite "\[\[.*\]\]" diff --git a/doc/syntax/makefile.nanorc b/doc/syntax/makefile.nanorc index f81d1e5aee57f62d5ee8b2b3dd2fc2d1e4e3dac2..041639099bad64b962ec0ef4afb62a82793d76d7 100644 --- a/doc/syntax/makefile.nanorc +++ b/doc/syntax/makefile.nanorc @@ -1,11 +1,12 @@ -## Syntax highlighting for Makefiles. -## (unattributed example from http://wiki.linuxhelp.net/) +## Here is an example for Makefiles. syntax "makefile" "Makefile[^/]*$" + color red "[:=]" color magenta "\<(if|ifeq|else|endif)\>" color blue "\$+[{(][a-zA-Z0-9_-]+[})]" color brightblue "^[^ ]+:" color green "#.*$" + ## Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/doc/syntax/man.nanorc b/doc/syntax/man.nanorc index cdee7a2de1c5038ca65460ed305c3e08316ebc3f..6c296bb6243f3e943cc5db4bbcddf008793c9bb3 100644 --- a/doc/syntax/man.nanorc +++ b/doc/syntax/man.nanorc @@ -1,14 +1,17 @@ ## Here is an example for manpages. -## + syntax "man" "\.[1-9]x?$" magic "troff or preprocessor input text" + color green "\.(SH|SS|TH) .*$" color brightgreen "\.(SH|SS|TH) " "\.([HIT]P)" color brightred "\.(B[IR]?|I[BR]?|R[BI]|S[BM]) .*$" color brightblue "\.(B[IR]?|I[BR]?|R[BI]|S[BM]) " "\.([LP]?P)$" color magenta "\\f[BIPR]" color yellow "\.(br|DT|RS|RE|PD)" + # Comments. color cyan "\.?\\\".*$" + # Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/doc/syntax/mgp.nanorc b/doc/syntax/mgp.nanorc index 8f2bc7443cc3d5b938e8e3b84fb86ba941871982..c0a5d203009d1bfb002ff2d22bfecf9c5101e96d 100644 --- a/doc/syntax/mgp.nanorc +++ b/doc/syntax/mgp.nanorc @@ -1,7 +1,8 @@ ## Here is an example for Magicpoint presentations. -## + syntax "mgp" "\.mgp$" header "^%include.*" + icolor green "^%[a-z].*$" color cyan "(^|[[:space:]])#.*$" color cyan "(^|[[:space:]])%%.*$" diff --git a/doc/syntax/mutt.nanorc b/doc/syntax/mutt.nanorc index 2e683998254d1897e202afacc1e87d1925cc56c5..9acd6a09515f4ef4e2543ac91f94bdf1c2a8682d 100644 --- a/doc/syntax/mutt.nanorc +++ b/doc/syntax/mutt.nanorc @@ -1,4 +1,5 @@ ## Here is an example for quoted emails (under e.g. mutt). -## + syntax "mutt" + color green "^>.*" diff --git a/doc/syntax/objc.nanorc b/doc/syntax/objc.nanorc index 2dddf02c68b074ed328c43ce86fa21f080ff71a4..bfbae1260a9e1e9a9a18c92d6485c09569cb63cc 100644 --- a/doc/syntax/objc.nanorc +++ b/doc/syntax/objc.nanorc @@ -1,9 +1,9 @@ ## Here is an example for C/C++/Obj-C. -## + syntax "m" "\.m$" -## Stuffs -color brightwhite "\<[A-Z_][0-9A-Z_]+\>" +# Stuffs, +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 "\<[[:alpha:]_][[:alnum:]_]*_t\>" color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>" @@ -12,27 +12,28 @@ color brightgreen "\<(try|throw|catch|operator|new|delete)\>" color brightgreen "\<(goto|continue|break|return)\>" 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)__" -## Selector/method +# Selector/method. color brightmagenta "(^|[[:space:]])\[.*[[:space:]].*\]" color white ":[[:alnum:]]*" color magenta "[[:alnum:]]*:" color white "\[[^][:space:]]*\]" -## String highlighting. You will in general want your comments and -## strings to come last, because syntax highlighting rules will be -## applied in the order they are read in. +# Strings. color brightblack "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'" color brightblack "<[^= ]*>" ""(\\.|[^"])*"" color brightblue "@"(\\.|[^"])*"" -## This string is VERY resource intensive! +# Multiline strings. This regex is VERY resource intensive! ## color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*"" +# Preprocessor commands. color brightblue "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error)" -## Comment highlighting +# Comments. color yellow "//.*" color yellow start="/\*" end="\*/" +# Trailing whitespace. Â +color ,green "[[:space:]]+$" diff --git a/doc/syntax/ocaml.nanorc b/doc/syntax/ocaml.nanorc index 3d07e1a11c5fb3792552f649c1958c3df9032d09..8decb727d4644896682f8a3637fbd4c343c99da2 100644 --- a/doc/syntax/ocaml.nanorc +++ b/doc/syntax/ocaml.nanorc @@ -1,6 +1,7 @@ ## Syntax highlighting for OCaml. syntax "ocaml" "\.mli?$" + #uid color red "\<[A-Z][0-9a-z_]{2,}\>" #declarations @@ -10,7 +11,7 @@ color red "\<(type|open|class|module|exception|external)\>" #patterns color blue "\<(fun|function|functor|match|try|with)\>" #patterns-modifiers -color yellow "\<(as|when|of)\>" +color yellow "\<(as|when|of)\>" #conditions color cyan "\<(if|then|else)\>" #blocs diff --git a/doc/syntax/perl.nanorc b/doc/syntax/perl.nanorc index a5bebf247a6a888f22808e32a4b991c8328e4056..5f39c176eb752ca437c861be56c6523ded0e4e31 100644 --- a/doc/syntax/perl.nanorc +++ b/doc/syntax/perl.nanorc @@ -1,4 +1,5 @@ ## Here is an example for Perl. + syntax "perl" "\.p[lm]$" header "^#!.*/perl[-0-9._]*" magic "Perl script text" diff --git a/doc/syntax/php.nanorc b/doc/syntax/php.nanorc index 44d3cf4dd4d5817641c43fc2749fb5cc4976acdd..e3c4f1fa1e747733040f54cfea3c3920c4952a34 100644 --- a/doc/syntax/php.nanorc +++ b/doc/syntax/php.nanorc @@ -1,31 +1,31 @@ ## Here is an example for PHP. -## + syntax "php" "\.php[2345s~]?$" magic "PHP script text" -## php markings +# PHP markings. color brightgreen "(<\?(php)?|\?>)" -## functions +# Functions. color white "\<[a-z_]*\(" -## types +# Types. 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)\>" -## control flow +# Control flow. color magenta "\<(goto|continue|break|return)\>" -## strings +# Strings. color brightyellow "<[^= ]*>" ""(\.|[^"])*"" -## comments +# Comments. color brightblue "//.*" color brightblue start="/\*" end="\*/" -#color blue start="<" end=">" -#color red "&[^;[[:space:]]]*;" +##color blue start="<" end=">" +##color red "&[^;[[:space:]]]*;" -## trailing whitespace +# Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/doc/syntax/po.nanorc b/doc/syntax/po.nanorc index db5acfac8afc72f1d8309783fa69295d1cc7ec9f..567ef7adc51590ac1f01719dffd554e28245b3bf 100644 --- a/doc/syntax/po.nanorc +++ b/doc/syntax/po.nanorc @@ -1,6 +1,7 @@ ## Colouring for PO files. -## + syntax "po" "\.pot?$" + # Comments. color green "^#.*$" color yellow "Copyright|\(C\)" diff --git a/doc/syntax/pov.nanorc b/doc/syntax/pov.nanorc index 298b20124ed86beb32a1abebc6eb1464dc205915..b7033b1090d6b58f94e14f1e12c695e86ea4a18d 100644 --- a/doc/syntax/pov.nanorc +++ b/doc/syntax/pov.nanorc @@ -1,6 +1,7 @@ ## Here is an example for POV-Ray. -## + syntax "pov" "\.(pov|POV|povray|POVRAY)$" + color brightcyan "^[[:space:]]*#[[:space:]]*(declare)" color brightyellow "\<(sphere|cylinder|translate|matrix|rotate|scale)\>" color brightyellow "\<(orthographic|location|up|right|direction|clipped_by)\>" @@ -10,6 +11,7 @@ color brightred "\<(light_source|background)\>" color brightred "\<(fog|object|camera)\>" color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)" color brightmagenta "\<(union|group|subgroup)\>" -## Comment highlighting + +# Comments. color brightblue "//.*" color brightblue start="/\*" end="\*/" diff --git a/doc/syntax/python.nanorc b/doc/syntax/python.nanorc index 423ce245447d014b79ba6ea25d1d653230766b7f..4679cf10e7d8eb0797c61e1e98d0baa6cd39d37a 100644 --- a/doc/syntax/python.nanorc +++ b/doc/syntax/python.nanorc @@ -1,5 +1,5 @@ ## Here is an example for Python. -## + syntax "python" "\.py$" header "^#!.*/python[-0-9._]*" diff --git a/doc/syntax/ruby.nanorc b/doc/syntax/ruby.nanorc index b30b229d0b505e2c5d3d1e61c885ed094da7afa1..3566e1fea4dd50f9a474444794158644d943908d 100644 --- a/doc/syntax/ruby.nanorc +++ b/doc/syntax/ruby.nanorc @@ -1,31 +1,32 @@ ## Here is an example for Ruby. -## + syntax "ruby" "\.rb$" 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)\>" -## Constants +# Constants. color brightblue "(\$|@|@@)?\<[A-Z]+[0-9A-Z_a-z]*" -## Ruby "symbols" +# Ruby "symbols". 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__)\>" -## Regular expressions +# Regular expressions. color brightmagenta "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*" -## Shell command expansion is in `backticks` or like %x{this}. These are -## "double-quotish" (to use a perlism). +# Shell command expansion is in `backticks` or like %x{this}. These are +# "double-quotish" (to use a perlism). color brightblue "`[^`]*`" "%x\{[^}]*\}" -## Strings, double-quoted +# Strings, double-quoted. color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!" -## Expression substitution. These go inside double-quoted strings, -## "like #{this}". +# Expression substitution. These go inside double-quoted strings, +# "like #{this}". color brightgreen "#\{[^}]*\}" -## Strings, single-quoted +# Strings, single-quoted. color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!" -## Comments +# Comments. color cyan "#[^{].*$" "#$" color brightcyan "##[^{].*$" "##$" -## "Here" docs +# "Here" docs. color green start="<<-?'?EOT'?" end="^EOT" -## Some common markers +# Some common markers. color brightcyan "(XXX|TODO|FIXME|\?\?\?)" diff --git a/doc/syntax/sh.nanorc b/doc/syntax/sh.nanorc index 1623d969fbb3a4bfb78b204bc6f2f16ecacd64b2..823cc5d1951e4df890a5d9898814b1e4126b12fd 100644 --- a/doc/syntax/sh.nanorc +++ b/doc/syntax/sh.nanorc @@ -1,8 +1,9 @@ ## Here is an example for Bourne shell scripts. -## + syntax "sh" "\.sh$" -magic "(POSIX|Bourne.*) shell script text" header "^#!.*/(ba|k|pdk)?sh[-0-9_]*" +magic "(POSIX|Bourne.*) shell script text" + 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 "\<(declare|eval|exec|export|let|local)\>" @@ -10,10 +11,17 @@ color green "[{}():;|`$<>!=&\\]" "(\]|\[)" color green "-[Ldefgruwx]\>" 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)\>" + # Basic variable names (no braces). color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*" # More complicated variable names; handles braces and replacements and arrays. color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})" + +# Comments. color cyan "(^|[[:space:]])#.*$" + +# Strings. color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'" + +# Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/doc/syntax/spec.nanorc b/doc/syntax/spec.nanorc index 1a5d2f9d148e0519fb391e3a75a16fdd77cdc4ce..a0fff88ad915fb1eeff00639391552cb78b4f762 100644 --- a/doc/syntax/spec.nanorc +++ b/doc/syntax/spec.nanorc @@ -1,8 +1,8 @@ ## Syntax highlighting for RPM spec files. -## Parts were taken from Kate's (KDE) syntax highlighting. -## Asterios Dramis + syntax "spec" "\.(spec$|spec\.*)" -# Main tags + +# Main tags. color brightblue "((Icon|ExclusiveOs|ExcludeOs)[[:space:]]*:)" color brightblue "((BuildArch|BuildArchitectures|ExclusiveArch|ExcludeArch)[[: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 "((Name|Version|Release|Url|URL)[[:space:]]*:)" 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)" -# Architecture conditionals +# Architecture conditionals. color brightred "(ifarch|ifnarch)" -# OS conditionals +# OS conditionals. color brightred "(ifos|ifnos)" -# %* strings +# %* strings. color green "%([A-Z_a-z_0-9_]*)" color magenta "%_([A-Z_a-z_0-9_]*)" color yellow start="%__" end="\ " color magenta 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 "^%(trigger|triggerin|triggerpostun|triggerun|verifyscript)" -# Conditionals and Defines +# Conditionals and defines. color brightred "%(if|else|endif|define|global|undefine)" -# Comments + +# Comments. color cyan "#.*$" -# "# norootforbuild" is handled as main tag +# Special case: "# norootforbuild" is handled as main tag. color brightblue "^# norootforbuild" -# %changelog date entries +# %changelog date entries. color brightyellow "^\* .*\)$" -# Trailing whitespace +# Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/doc/syntax/tex.nanorc b/doc/syntax/tex.nanorc index 23ca3a4402dec4cfdab60992dfe44fe77126af36..7fa417c4d5ae1f0b54a00bd4afda7e7de0fa0618 100644 --- a/doc/syntax/tex.nanorc +++ b/doc/syntax/tex.nanorc @@ -1,6 +1,7 @@ ## Here is a short example for TeX files. -## + syntax "tex" "\.tex$" + icolor green "\\.|\\[A-Z]*" color magenta "[{}]" color blue "(^|[^\])%.*" diff --git a/doc/syntax/texinfo.nanorc b/doc/syntax/texinfo.nanorc index ca62aacba0d2f9a3eea1e0578bbd8ddaa59cc081..63354bae9c7cd7bc53694f13865eefab302aabad 100644 --- a/doc/syntax/texinfo.nanorc +++ b/doc/syntax/texinfo.nanorc @@ -1,5 +1,5 @@ ## Here is an example for Texinfo files. -## + syntax "texinfo" "\.texi$" header "^\\input texinfo" magic "Texinfo source text"