+2014-02-23 Benno Schulenberg <bensberg@justemail.net>
+ * doc/syntax/*.nanorc - Comment and punctuation tweaks.
+
2014-02-23 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (do_undo, do_redo, add_undo) - Make warning
sentences in the status bar consistently end in a period.
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.
color magenta "\<(goto|continue|break|return)\>"
color brightcyan "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)"
color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
-##
+
## GCC builtins
color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
-##
+
## 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.
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
-##
+
## This string is VERY resource intensive!
color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
-## CMake syntax highlighter for GNU Nano
+## Syntax highlighting for CMake files.
##
syntax "cmake" "(CMakeLists\.txt|\.cmake)$"
-## Here is an example for css files.
+## Here is an example for CSS files.
##
syntax "css" "\.css$"
color brightred "."
-## Here is an exmaple for apt's sources.list
-## Adapted from http://milianw.de/blog/Syntax-Highlighting-in-Nano
-## (mail@milianw.de).
+## Here is an exmaple for apt's sources.list.
+## (adapted from http://milianw.de/blog/Syntax-Highlighting-in-Nano)
##
syntax "apt/sources.list" "sources\.list(\.old|~)?$"
# component
-## Here is an example for Fortran 90/95
+## Here is an example for Fortran 90/95.
syntax "fortran" "\.(f|f90|f95)$"
-## Here is an example for Gentoo ebuilds/eclasses
+## Here is an example for Gentoo ebuilds/eclasses.
##
syntax "ebuild" "\.e(build|class)$"
## All the standard portage functions
## Trailing space is bad!
color ,green "[[:space:]]+$"
-## Here is an example for Portage control files
+## Here is an example for Portage control files.
##
syntax "/etc/portage" "\.(keywords|mask|unmask|use)(/.+)?$"
## Base text:
# Symbols
color brightmagenta "(\(|\)|\[|\]|\{|\})"
-
# Shebang
color brightcyan "^#!.*"
# Multiline comments
color green start="\-\-\[\[" end="\]\]"
-# Strings
-#color green "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'"
-
# Strings
color red "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'"
-
-# color red start="\[\[" end="\]\]"
-
+##color red start="\[\[" end="\]\]"
# Hex literals
color red "0x[0-9a-fA-F]*"
-
-
-# unattributed syntax highlighting example from wiki.linuxhelp.net/
+## Syntax highlighting for Makefiles.
+## (unattributed example from http://wiki.linuxhelp.net/)
syntax "makefile" "Makefile[^/]*$"
color red "[:=]"
-## Here is an example for Magicpoint presentations
+## Here is an example for Magicpoint presentations.
##
syntax "mgp" "\.mgp$"
header "^%include.*"
##
syntax "m" "\.m$"
-
## 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 brightgreen "\<(try|throw|catch|operator|new|delete)\>"
color brightgreen "\<(goto|continue|break|return)\>"
color brightgreen "@\<(en(code|d)|i(mplementation|nterface)|selector)\>"
-##
+
## GCC builtins
color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
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.
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!
## color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
-# OCaml sample nanorc
-#
+## Syntax highlighting for OCaml.
+
syntax "ocaml" "\.mli?$"
#uid
color red "\<[A-Z][0-9a-z_]{2,}\>"
-## Here is an example for PHP
+## Here is an example for PHP.
##
syntax "php" "\.php[2345s~]?$"
magic "PHP script text"
#color blue start="<" end=">"
#color red "&[^;[[:space:]]]*;"
-## Trailing whitespace
+## trailing whitespace
color ,green "[[:space:]]+$"
-# RPM spec files syntax highlighting
-# Parts taken from kate (KDE) syntax highlighting
-# Asterios Dramis
+## Syntax highlighting for RPM spec files.
+## Parts were taken from Kate's (KDE) syntax highlighting.
+## Asterios Dramis
syntax "spec" "\.(spec$|spec\.*)"
# Main tags
color brightblue "((Icon|ExclusiveOs|ExcludeOs)[[:space:]]*:)"
color brightblue start="^Source" end=":" start="^Patch" end=":"
# 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)"
-# Architectures conditionals
+# Architecture conditionals
color brightred "(ifarch|ifnarch)"
# OS conditionals
color brightred "(ifos|ifnos)"
+## Syntax highlighting for Tcl files.
+
syntax "tcl" "\.tcl$"
-## Standard Tcl [info commands]
+# Standard Tcl [info commands]:
color green "\<(after|append|array|auto_execok|auto_import|auto_load|auto_load_index|auto_qualify|binary|break|case|catch|cd|clock|close|concat|continue|encoding|eof|error|eval|exec|exit|expr|fblocked|fconfigure|fcopy|file|fileevent|flush|for|foreach|format|gets|glob|global|history|if|incr|info|interp|join|lappend|lindex|linsert|list|llength|load|lrange|lreplace|lsearch|lset|lsort|namespace|open|package|pid|puts|pwd|read|regexp|regsub|rename|return|scan|seek|set|socket|source|split|string|subst|switch|tclLog|tell|time|trace|unknown|unset|update|uplevel|upvar|variable|vwait|while)\>"
-## Basic Tcl sub commands.
+# Basic Tcl subcommands:
color green "\<(array anymore|array donesearch|array exists|array get|array names|array nextelement|array set|array size|array startsearch|array statistics|array unset)\>"
color green "\<(string bytelength|string compare|string equal|string first|string index|string is|string last|string length|string map|string match|string range|string repeat|string replace|string to|string tolower|string totitle|string toupper|string trim|string trimleft|string trimright|string will|string wordend|string wordstart)\>"
-## Extended TclX [info commands]
+# Extended TclX [info commands]:
color green "\<(alarm|auto_load_pkg|bsearch|catclose|catgets|catopen|ccollate|cconcat|cequal|chgrp|chmod|chown|chroot|cindex|clength|cmdtrace|commandloop|crange|csubstr|ctoken|ctype|dup|echo|execl|fcntl|flock|fork|fstat|ftruncate|funlock|host_info|id|infox|keyldel|keylget|keylkeys|keylset|kill|lassign|lcontain|lempty|lgets|link|lmatch|loadlibindex|loop|lvarcat|lvarpop|lvarpush|max|min|nice|pipe|profile|random|readdir|replicate|scancontext|scanfile|scanmatch|select|server_accept|server_create|signal|sleep|sync|system|tclx_findinit|tclx_fork|tclx_load_tndxs|tclx_sleep|tclx_system|tclx_wait|times|translit|try_eval|umask|wait)\>"
-## Syntax.
+# Syntax:
color brightblue "proc[[:space:]]" "(\{|\})"
color green "(\(|\)|\;|`|\\|\$|<|>|!|=|&|\|)"
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
-## Here is an example for xml files.
+## Here is an example for XML files.
##
syntax "xml" "\.([jrs]html?|sgml?|xml|xslt?)$"
magic "XML.*document text"