aboutsummaryrefslogtreecommitdiffstats
path: root/doc/syntax
diff options
context:
space:
mode:
Diffstat (limited to 'doc/syntax')
-rw-r--r--doc/syntax/Makefile.am7
-rw-r--r--doc/syntax/Makefile.in124
-rw-r--r--doc/syntax/asm.nanorc13
-rw-r--r--doc/syntax/awk.nanorc27
-rw-r--r--doc/syntax/c.nanorc32
-rw-r--r--doc/syntax/changelog.nanorc25
-rw-r--r--doc/syntax/cmake.nanorc4
-rw-r--r--doc/syntax/css.nanorc5
-rw-r--r--doc/syntax/debian.nanorc31
-rw-r--r--doc/syntax/default.nanorc13
-rw-r--r--doc/syntax/fortran.nanorc32
-rw-r--r--doc/syntax/gentoo.nanorc56
-rw-r--r--doc/syntax/go.nanorc42
-rw-r--r--doc/syntax/groff.nanorc21
-rw-r--r--doc/syntax/html.nanorc10
-rw-r--r--doc/syntax/java.nanorc3
-rw-r--r--doc/syntax/javascript.nanorc19
-rw-r--r--doc/syntax/json.nanorc32
-rw-r--r--doc/syntax/lua.nanorc26
-rw-r--r--doc/syntax/makefile.nanorc6
-rw-r--r--doc/syntax/man.nanorc21
-rw-r--r--doc/syntax/mgp.nanorc5
-rw-r--r--doc/syntax/mutt.nanorc7
-rw-r--r--doc/syntax/nanorc.nanorc32
-rw-r--r--doc/syntax/objc.nanorc26
-rw-r--r--doc/syntax/ocaml.nanorc7
-rw-r--r--doc/syntax/patch.nanorc14
-rw-r--r--doc/syntax/perl.nanorc5
-rw-r--r--doc/syntax/php.nanorc24
-rw-r--r--doc/syntax/po.nanorc27
-rw-r--r--doc/syntax/pov.nanorc6
-rw-r--r--doc/syntax/python.nanorc20
-rw-r--r--doc/syntax/ruby.nanorc31
-rw-r--r--doc/syntax/sh.nanorc24
-rw-r--r--doc/syntax/spec.nanorc29
-rw-r--r--doc/syntax/tcl.nanorc10
-rw-r--r--doc/syntax/tex.nanorc3
-rw-r--r--doc/syntax/texinfo.nanorc20
-rw-r--r--doc/syntax/xml.nanorc7
39 files changed, 582 insertions, 264 deletions
diff --git a/doc/syntax/Makefile.am b/doc/syntax/Makefile.am
index 13bf6194..03bc8e3e 100644
--- a/doc/syntax/Makefile.am
+++ b/doc/syntax/Makefile.am
@@ -1,14 +1,19 @@
pkgdata_DATA = asm.nanorc \
awk.nanorc \
+ changelog.nanorc \
cmake.nanorc \
c.nanorc \
css.nanorc \
debian.nanorc \
+ default.nanorc \
fortran.nanorc \
gentoo.nanorc \
+ go.nanorc \
groff.nanorc \
html.nanorc \
java.nanorc \
+ javascript.nanorc \
+ json.nanorc \
lua.nanorc \
makefile.nanorc \
man.nanorc \
@@ -20,6 +25,7 @@ pkgdata_DATA = asm.nanorc \
patch.nanorc \
perl.nanorc \
php.nanorc \
+ po.nanorc \
pov.nanorc \
python.nanorc \
ruby.nanorc \
@@ -27,6 +33,7 @@ pkgdata_DATA = asm.nanorc \
spec.nanorc \
tcl.nanorc \
tex.nanorc \
+ texinfo.nanorc \
xml.nanorc
EXTRA_DIST = $(pkgdata_DATA)
diff --git a/doc/syntax/Makefile.in b/doc/syntax/Makefile.in
index 2f3dd6e7..c61d0134 100644
--- a/doc/syntax/Makefile.in
+++ b/doc/syntax/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -16,23 +15,51 @@
@SET_MAKE@
VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
- test $$am__dry = yes; \
- }
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -52,9 +79,11 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = doc/syntax
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
+ $(top_srcdir)/m4/ax_check_compile_flag.m4 \
$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glib-2.0.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/isc-posix.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
@@ -66,6 +95,18 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
@@ -102,9 +143,11 @@ am__uninstall_files_from_dir = { \
}
am__installdirs = "$(DESTDIR)$(pkgdatadir)"
DATA = $(pkgdata_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -150,7 +193,11 @@ MKDIR_P = @MKDIR_P@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
+NCURSESW_CFLAGS = @NCURSESW_CFLAGS@
NCURSESW_CONFIG = @NCURSESW_CONFIG@
+NCURSESW_LIBS = @NCURSESW_LIBS@
+NCURSES_CFLAGS = @NCURSES_CFLAGS@
+NCURSES_LIBS = @NCURSES_LIBS@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -162,6 +209,8 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGDATADIR = @PKGDATADIR@
PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POSUB = @POSUB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -191,6 +240,7 @@ datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+haveit = @haveit@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
@@ -221,15 +271,20 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
pkgdata_DATA = asm.nanorc \
awk.nanorc \
+ changelog.nanorc \
cmake.nanorc \
c.nanorc \
css.nanorc \
debian.nanorc \
+ default.nanorc \
fortran.nanorc \
gentoo.nanorc \
+ go.nanorc \
groff.nanorc \
html.nanorc \
java.nanorc \
+ javascript.nanorc \
+ json.nanorc \
lua.nanorc \
makefile.nanorc \
man.nanorc \
@@ -241,6 +296,7 @@ pkgdata_DATA = asm.nanorc \
patch.nanorc \
perl.nanorc \
php.nanorc \
+ po.nanorc \
pov.nanorc \
python.nanorc \
ruby.nanorc \
@@ -248,6 +304,7 @@ pkgdata_DATA = asm.nanorc \
spec.nanorc \
tcl.nanorc \
tex.nanorc \
+ texinfo.nanorc \
xml.nanorc
EXTRA_DIST = $(pkgdata_DATA)
@@ -305,11 +362,11 @@ uninstall-pkgdataDATA:
@list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir)
-tags: TAGS
-TAGS:
+tags TAGS:
+
+ctags CTAGS:
-ctags: CTAGS
-CTAGS:
+cscope cscopelist:
distdir: $(DISTFILES)
@@ -447,16 +504,17 @@ uninstall-am: uninstall-pkgdataDATA
.MAKE: install-am install-strip
-.PHONY: all all-am check check-am clean clean-generic distclean \
- distclean-generic distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-pkgdataDATA install-ps \
- install-ps-am install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
- uninstall-am uninstall-pkgdataDATA
+.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
+ ctags-am distclean distclean-generic distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-pkgdataDATA install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am tags-am uninstall uninstall-am \
+ uninstall-pkgdataDATA
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/doc/syntax/asm.nanorc b/doc/syntax/asm.nanorc
index 9d927604..4e215915 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 b84d2fdc..bfc6387c 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,14 +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 59f0f3b6..8fe7088d 100644
--- a/doc/syntax/c.nanorc
+++ b/doc/syntax/c.nanorc
@@ -1,9 +1,10 @@
## Here is an example for C/C++.
-##
-syntax "c" "\.(c(c|pp|xx)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$"
-magic "ASCII C(\+\+)? program text"
-color brightred "\<[A-Z_][0-9A-Z_]+\>"
-color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>"
+
+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 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)\>"
color brightyellow "\<(for|if|while|do|else|case|default|switch)\>"
@@ -11,21 +12,22 @@ color brightyellow "\<(try|throw|catch|operator|new|delete)\>"
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
+
+# 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.
+
+# Strings. In general you will want your strings and comments to come last,
+# because highlighting rules are applied in the order they are read in.
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
-##
-## This string is VERY resource intensive!
+# Multiline strings. This regex is VERY resource intensive!
color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
-## Comment highlighting
+# Comments.
color brightblue "//.*"
color brightblue start="/\*" end="\*/"
-## Trailing whitespace
+# Reminders.
+color ,yellow "(FIXME|TODO|XXX)"
+
+# Trailing whitespace.
color ,green "[[:space:]]+$"
diff --git a/doc/syntax/changelog.nanorc b/doc/syntax/changelog.nanorc
new file mode 100644
index 00000000..60666bd5
--- /dev/null
+++ b/doc/syntax/changelog.nanorc
@@ -0,0 +1,25 @@
+## Colouring for Changelogs.
+
+syntax "changelog" "Change[Ll]og.*"
+
+# Author lines.
+color green "^(19|20).*$"
+# Dates.
+color red "^(19|20)[0-9-]{8}"
+# Email addresses.
+color yellow "<[^>]*@[^>]*>"
+
+# Changed files.
+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_]+\>"
+# Key sequences.
+color brightblue "\^[A-Z]" "\<M-." "\<F1?[0-9]" "(\^|M-)Space"
+
+# Trailing whitespace.
+color ,green "[[:space:]]+$"
diff --git a/doc/syntax/cmake.nanorc b/doc/syntax/cmake.nanorc
index 3c52f7de..dc437024 100644
--- a/doc/syntax/cmake.nanorc
+++ b/doc/syntax/cmake.nanorc
@@ -1,5 +1,5 @@
-## CMake syntax highlighter for GNU Nano
-##
+## 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 98eea180..a806d7c5 100644
--- a/doc/syntax/css.nanorc
+++ b/doc/syntax/css.nanorc
@@ -1,6 +1,7 @@
-## Here is an example for css files.
-##
+## 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/debian.nanorc b/doc/syntax/debian.nanorc
index a945deea..1083abe7 100644
--- a/doc/syntax/debian.nanorc
+++ b/doc/syntax/debian.nanorc
@@ -1,20 +1,19 @@
-## 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 example for apt's sources.list.
+
syntax "apt/sources.list" "sources\.list(\.old|~)?$"
-# component
-color brightmagenta "^deb(-src)? ((http|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/) [^ ]+ .+$"
-# distribution
-color brightred "^deb(-src)? ((http|file|ftp):/[^ ]+|cdrom:\[[^\]]+\]/|cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/) [^ ]+"
-# URI
-color brightgreen "(http|file|ftp):/[^ ]+"
-# cdroms
-# [^\]] does not work...
+
+# Coloring the deb lines, working from tail to head. First the
+# components -- well, everything, and thus also the components.
+color brightmagenta "^deb.*"
+# Distribution -- well, everything, except the components.
+color brightred "^deb(-src)? ((http|ftp|rsh|ssh|file|copy):/[^ ]+|cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/) [^ ]+"
+# URIs.
+color brightgreen "(http|ftp|rsh|ssh|file|copy):/[^ ]+"
+# CDroms.
color brightgreen "cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/"
-# deb / deb-src
-color yellow "^deb"
-color yellow "^deb-src"
-# comments
+# And finally the initial deb tag.
+color yellow "^deb(-src)?"
+
+# Comments.
color brightblue "#.*"
diff --git a/doc/syntax/default.nanorc b/doc/syntax/default.nanorc
new file mode 100644
index 00000000..8d8e0397
--- /dev/null
+++ b/doc/syntax/default.nanorc
@@ -0,0 +1,13 @@
+## A default syntax, which is used
+## for files that do not match any other syntax.
+
+syntax "default"
+
+# Spaces in front of tabs.
+color ,red " + +"
+
+# Trailing blanks.
+color ,red "[[:blank:]]+$"
+
+# Nano's name, including version.
+color brightred "(GNU )?nano [1-9]\.[0-9]\.[^[:space:][:punct:]]+"
diff --git a/doc/syntax/fortran.nanorc b/doc/syntax/fortran.nanorc
index cc0c726a..45873ac7 100644
--- a/doc/syntax/fortran.nanorc
+++ b/doc/syntax/fortran.nanorc
@@ -1,9 +1,8 @@
-## Here is an example for Fortran 90/95
+## Here is an example for Fortran 90/95.
-syntax "fortran" "\.(f|f90|f95)$"
+syntax "fortran" "\.(f|f90|f95)$"
-#color red "\<[A-Z_]a[0-9A-Z_]+\>"
-color red "\<[0-9]+\>"
+color red "\<[0-9]+\>"
icolor green "\<(action|advance|all|allocatable|allocated|any|apostrophe)\>"
icolor green "\<(append|asis|assign|assignment|associated|character|common)\>"
@@ -15,16 +14,16 @@ icolor green "\<(operator|optional|pack|parameter|pointer|position|private)\>"
icolor green "\<(program|public|real|recl|recursive|selected_int_kind)\>"
icolor green "\<(selected_real_kind|subroutine|status)\>"
-icolor cyan "\<(abs|achar|adjustl|adjustr|allocate|bit_size|call|char)\>"
-icolor cyan "\<(close|contains|count|cpu_time|cshift|date_and_time)\>"
-icolor cyan "\<(deallocate|digits|dot_product|eor|eoshift|function|iachar)\>"
-icolor cyan "\<(iand|ibclr|ibits|ibset|ichar|ieor|iolength|ior|ishft|ishftc)\>"
-icolor cyan "\<(lbound|len|len_trim|matmul|maxexponent|maxloc|maxval|merge)\>"
-icolor cyan "\<(minexponent|minloc|minval|mvbits|namelist|nearest|nullify)\>"
-icolor cyan "\<(open|pad|present|print|product|pure|quote|radix)\>"
-icolor cyan "\<(random_number|random_seed|range|read|readwrite|replace)\>"
-icolor cyan "\<(reshape|rewind|save|scan|sequence|shape|sign|size|spacing)\>"
-icolor cyan "\<(spread|sum|system_clock|target|transfer|transpose|trim)\>"
+icolor cyan "\<(abs|achar|adjustl|adjustr|allocate|bit_size|call|char)\>"
+icolor cyan "\<(close|contains|count|cpu_time|cshift|date_and_time)\>"
+icolor cyan "\<(deallocate|digits|dot_product|eor|eoshift|function|iachar)\>"
+icolor cyan "\<(iand|ibclr|ibits|ibset|ichar|ieor|iolength|ior|ishft|ishftc)\>"
+icolor cyan "\<(lbound|len|len_trim|matmul|maxexponent|maxloc|maxval|merge)\>"
+icolor cyan "\<(minexponent|minloc|minval|mvbits|namelist|nearest|nullify)\>"
+icolor cyan "\<(open|pad|present|print|product|pure|quote|radix)\>"
+icolor cyan "\<(random_number|random_seed|range|read|readwrite|replace)\>"
+icolor cyan "\<(reshape|rewind|save|scan|sequence|shape|sign|size|spacing)\>"
+icolor cyan "\<(spread|sum|system_clock|target|transfer|transpose|trim)\>"
icolor cyan "\<(ubound|unpack|verify|write|tiny|type|use|yes)\>"
icolor yellow "\<(.and.|case|do|else|else?if|else?where|end|end?do|end?if)\>"
@@ -33,9 +32,8 @@ icolor yellow "\<(.or.|repeat|select case|then|where|while)\>"
icolor magenta "\<(continue|cycle|exit|go?to|result|return)\>"
-## String highlighting.
+# Strings.
icolor yellow "<[^= ]*>" ""(\\.|[^"])*""
-## Comment highlighting
+# Comments.
icolor blue "!.*"
-
diff --git a/doc/syntax/gentoo.nanorc b/doc/syntax/gentoo.nanorc
index 2ad15971..249e224d 100644
--- a/doc/syntax/gentoo.nanorc
+++ b/doc/syntax/gentoo.nanorc
@@ -1,31 +1,41 @@
-## 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
-color brightgreen "^src_(unpack|prepare|configure|compile|install|test)" "^pkg_(config|nofetch|setup|(pre|post)(inst|rm))"
+color brightgreen "(^|\<default_)src_(unpack|prepare|configure|compile|install|test)\>"
+color brightgreen "^pkg_(config|nofetch|info|pretend|setup|(pre|post)(inst|rm))\>"
+color brightgreen "\<default(_pkg_nofetch|_src_(unpack|prepare|configure|compile|test))?\>"
## Highlight bash related syntax
-color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while|continue|break)\>"
-color green "\<(declare|eval|exec|let)\>"
-color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
-color green "-[edfgruwxL]\>"
-color green "-(eq|ne|gt|lt|ge|le|s|n|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)\>"
+color green "[{}():;|`$<>!=&\\]" "(\]|\[)"
+color green "-[defhnrsuwxzL]\>"
+color green "-(eq|ne|gt|lt|ge|le)\>"
## Highlight variables ... official portage ones in red, all others in bright red
-color brightred "\$\{?[a-zA-Z_0-9]+\}?"
-color red "\<(EAPI|ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|(P|R)?DEPEND|PROVIDE|PROPERTIES|RESTRICT|USERLAND)\>"
-color red "\<(S|D|T|PV|PF|P|PN|PR|PVR|A|CATEGORY|DISTDIR|FILESDIR|ROOT|WORKDIR)\>" "\<(AS|C(PP|XX)?|LD)FLAGS\>" "\<C(HOST|TARGET|BUILD)\>"
-color red "\<QA_((TEXTRELS|EXECSTACK|WX_LOAD)(_[a-zA-Z_0-9]+)?|DT_HASH|PRESTRIPPED)\>" "\<WANT_AUTO(CONF|MAKE)\>" "\<AT_M4DIR\>"
+color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*"
+color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:digit:]]|@)+\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
+color red "\<(EAPI|ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|[HPR]?DEPEND|PROVIDE|PROPERTIES|REQUIRED_USE|RESTRICT|USERLAND)\>"
+color red "\<(S|E?D|T|PV|PF|P|PN|PR|PVR|A|CATEGORY|DISTDIR|FILESDIR|EPREFIX|E?ROOT|WORKDIR)\>"
+color red "\<(AS|C(PP|XX)?|LD)FLAGS\>" "\<C(HOST|TARGET|BUILD)\>" "\<(MERGE_TYPE|REPLACING_VERSIONS|REPLACED_BY_VERSION)\>"
+color red "\<EBUILD_PHASE(_FUNC)?\>"
+color red "\<QA_((TEXTRELS|EXECSTACK|WX_LOAD)(_[a-zA-Z_0-9]+)?|DT_HASH|PRESTRIPPED)\>"
+color red "\<(PATCHES|(HTML_)?DOCS)\>" "\<WANT_(AUTO(CONF|MAKE)|LIBTOOL)\>" "\<AT_M4DIR\>"
## Highlight portage commands
-color magenta "\<use(_(with|enable))?\> [!a-zA-Z0-9_+ -]*" "inherit.*"
-color brightblue "\<e(begin|end|conf|install|make|qmake[34]|ant|(qa)?warn|infon?|error|log|patch|new(group|user))\>"
-color brightblue "\<e(pause|beep|mktemp|(cvs|svn)_clean|punt_cxx)\>" "\<e(aclocal|auto(reconf|header|conf|make))\>"
-color brightblue "\<built_with_use\>" "\<make_desktop_entry\>" "\<unpack(_(makeself|pdv))?\>"
-color brightblue "\<die\>" "\<use(_(with|enable))?\>" "\<inherit\>" "\<has\>" "\<(has|best)_version\>"
+color magenta "\<(use(_(with|enable|if_iuse)|x)?|in_iuse)\> [!a-zA-Z0-9_+ -]*" "inherit.*"
+color brightblue "\<e(begin|end|conf|install|make|qmake4|ant|(qa)?warn|infon?|error|log|patch(_user)?|new(group|user))\>"
+color brightblue "\<e(pause|beep|mktemp|(cvs|svn)_clean|punt_cxx)\>" "\<e(aclocal|auto(reconf|header|conf|make)|libtoolize)\>"
+color brightblue "\<e(stack|shopts|umask)_(push|pop)\>" "\<version_is_at_least\>"
+color brightblue "\<make_desktop_entry\>" "\<unpack(_(makeself|pdv))?\>"
+color brightblue "\<(die|hasv?|inherit|nonfatal)\>" "\<(use(_(with|enable|if_iuse)|x)?|in_iuse)\>" "\<(has|best)_version\>"
color brightblue "\<(do|new)(ins|(games)?s?bin|doc|lib(\.so|\.a)?|man|info|exe|initd|confd|envd|pam|menu|icon)\>"
-color brightblue "\<do(python|sed|dir|hard|sym|html|jar|mo)\>" "\<keepdir\>"
-color brightblue "prepall(docs|info|man|strip)?" "prep(info|lib|lib\.(so|a)|man|strip|gamesdirs)"
+color brightblue "\<do(compress|header|python|sed|dir|hard|sym|html|jar|mo)\>" "\<keepdir\>"
+color brightblue "\<prepall(docs|info|man|strip)?\>" "\<prep(info|lib|lib\.(so|a)|man|strip|gamesdirs)\>"
color brightblue "\<(doc|ins|exe)?into\>" "\<(f|games)(owners|perms)\>" "\<(exe|ins|dir)opts\>"
+color brightblue "\<tc-get(BUILD_)?(AR|AS|CC|CPP|CXX|LD|NM|OBJCOPY|PKG_CONFIG|RANLIB)\>"
+color brightblue "\<tc-(arch(-kernel)?|export|has-(tls|openmp))\>"
## Highlight common commands used in ebuilds
-color blue "\<make\>" "\<(awk|cat|cd|chmod|chown|cp|echo|env|export|find|e?grep|ln|mkdir|mv|rm|sed|set|tar|touch|unset|xargs)\>"
+color blue "\<(awk|cat|cd|chmod|chown|cp|echo|env|find|e?grep|ln|make|mkdir|mv|popd|printf|pushd|rm|rmdir|sed|set|tar|touch|unset|xargs)\>"
## Highlight comments (doesnt work that well)
color yellow "(^|[[:space:]])#.*$"
## Highlight strings (doesnt work that well)
@@ -33,9 +43,9 @@ color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
## 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)(/.+)?$"
+syntax "/etc/portage" "\.(accept_keywords|env|keywords|mask|unmask|use)(/.+)?$"
## Base text:
color green "^.+$"
## Use flags:
@@ -53,3 +63,5 @@ color cyan "^[[:space:]]*.*/"
color brightmagenta "^[[:space:]]*(=|~|<|<=|=<|>|>=|=>)"
## Comments:
color yellow "#.*$"
+## Trailing space is bad!
+color ,green "[[:space:]]+$"
diff --git a/doc/syntax/go.nanorc b/doc/syntax/go.nanorc
new file mode 100644
index 00000000..58ef1812
--- /dev/null
+++ b/doc/syntax/go.nanorc
@@ -0,0 +1,42 @@
+## Here is an example for Go.
+
+syntax "go" "\.go$"
+
+# Types.
+color green "\<(bool|u?int(8|16|32|64)?|float(32|64)|complex(64|128)|byte|rune|uintptr|string|error)\>"
+color green "\<((<-[[:space:]]*)chan|chan[[:space:]]*<-|const|func|interface|map|struct|type|var)\>"
+
+# Predefined functions.
+color blue "\<(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\>"
+
+# Control structures.
+color brightyellow "\<(case|default|defer|else|for|go|if|range|select|switch)\>"
+
+# Control flow.
+color magenta "\<(break|continue|fallthrough|goto|return)\>"
+
+# Declarations.
+color brightcyan "\<(package|import)\>"
+color brightcyan "//[[:space:]]*\+build[[:space:]]+(([a-zA-Z_0-9]+[[:space:]]*)+,[[:space:]]*)*[a-zA-Z_0-9]+"
+
+# Literals.
+color red "\<[0-9]+\.[0-9]*([Ee][+-][0-9]+)?i?\>"
+color red "\<[0-9]+[Ee][+-][0-9]+i?\>"
+color red "\<\.[0-9]+([Ee][+-][0-9]+)?i?\>"
+color red "\<[0-9]+i\>"
+color red "\<[1-9][0-9]*\>"
+color red "\<0[0-7]*\>"
+icolor red "\<0x[0-9a-f]+\>"
+
+# Strings and characters; slightly fuzzy.
+color red "\<(true|false|nil|iota|_)\>"
+color red "'(\\.|[^'])+'"
+color red ""(\\.|[^"])*""
+color red start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
+
+# Comments.
+color brightblue "//.*"
+color brightblue start="/\*" end="\*/"
+
+# Trailing whitespace.
+color ,green "[[:space:]]+$"
diff --git a/doc/syntax/groff.nanorc b/doc/syntax/groff.nanorc
index 02b82b8e..70f641d3 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 c94bfec9..8782dc36 100644
--- a/doc/syntax/html.nanorc
+++ b/doc/syntax/html.nanorc
@@ -1,6 +1,8 @@
## Here is a short example for HTML.
-##
-syntax "html" "\.html$"
+
+syntax "html" "\.html?$"
magic "HTML document text"
-color blue start="<" end=">"
-color red "&[^;[[:space:]]]*;"
+
+color cyan start="<" end=">"
+color red "&[^;[:space:]]*;"
+color green ""(\\.|[^"])*""
diff --git a/doc/syntax/java.nanorc b/doc/syntax/java.nanorc
index f45b0c94..0beebf47 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
new file mode 100644
index 00000000..991f54bf
--- /dev/null
+++ b/doc/syntax/javascript.nanorc
@@ -0,0 +1,19 @@
+## 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)\>"
+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}'"
+
+# Strings.
+color brightyellow "<[^= ]*>" ""(\\.|[^"])*"" "'(\\.|[^'])*'"
+# Comments.
+color brightblue "//.*"
+color brightblue start="/\*" end="\*/"
+
+# Trailing whitespace.
+color ,green "[[:space:]]+$"
diff --git a/doc/syntax/json.nanorc b/doc/syntax/json.nanorc
new file mode 100644
index 00000000..0f799f16
--- /dev/null
+++ b/doc/syntax/json.nanorc
@@ -0,0 +1,32 @@
+## Syntax highlighting for JSON files.
+
+# See: http://www.json.org/
+# Original author: Aapo Rantalainen
+# License: GPLv3 or newer
+
+syntax "json" "\.json$"
+
+# Numbers (used as value).
+color green ":[[:space:]]*\-?(0|[1-9][0-9]*)(\.[0-9]+)?([Ee]?[-+]?[0-9]+)?"
+# Values (well, any string).
+color brightmagenta "\".+\""
+# Hex numbers (used as value).
+color green ":[[:space:]]*\"#[0-9abcdefABCDEF]+\""
+# Escapes.
+color green "\\\\" "\\\"" "\\[bfnrt]" "\\u[0-9abcdefABCDEF]{4})"
+# Special words.
+color green "(true|false|null)"
+
+# Names (very unlikely to contain a quote).
+color brightblue "\"[^"]+\"[[:space:]]*:"
+
+# Brackets, braces, and separators.
+color brightblue "\[" "\]"
+color brightred "\{" "\}"
+color brightred "," ":"
+
+# Comments.
+color cyan "(^|[[:space:]]+)(//|#).*$"
+
+# Trailing whitespace.
+color ,green "[[:space:]]+$"
diff --git a/doc/syntax/lua.nanorc b/doc/syntax/lua.nanorc
index af9d1402..7512f53c 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 "\[\[.*\]\]"
@@ -51,7 +43,6 @@ color red "\<([0-9]+)\>"
# Symbols
color brightmagenta "(\(|\)|\[|\]|\{|\})"
-
# Shebang
color brightcyan "^#!.*"
@@ -62,15 +53,8 @@ color green "\-\-.*$"
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]*"
-
-
diff --git a/doc/syntax/makefile.nanorc b/doc/syntax/makefile.nanorc
index 93a1e76d..04163909 100644
--- a/doc/syntax/makefile.nanorc
+++ b/doc/syntax/makefile.nanorc
@@ -1,8 +1,12 @@
-# unattributed syntax highlighting example from 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 0dfa6feb..6c296bb6 100644
--- a/doc/syntax/man.nanorc
+++ b/doc/syntax/man.nanorc
@@ -1,10 +1,17 @@
## Here is an example for manpages.
-##
+
syntax "man" "\.[1-9]x?$"
magic "troff or preprocessor input text"
-color green "\.(S|T)H.*$"
-color brightgreen "\.(S|T)H" "\.TP"
-color brightred "\.(BR?|I[PR]?).*$"
-color brightblue "\.(BR?|I[PR]?|PP)"
-color brightwhite "\\f[BIPR]"
-color yellow "\.(br|DS|RS|RE|PD)"
+
+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 daba2827..c0a5d203 100644
--- a/doc/syntax/mgp.nanorc
+++ b/doc/syntax/mgp.nanorc
@@ -1,7 +1,8 @@
-## Here is an example for Magicpoint presentations
-##
+## 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 2e683998..80fbcf46 100644
--- a/doc/syntax/mutt.nanorc
+++ b/doc/syntax/mutt.nanorc
@@ -1,4 +1,9 @@
## Here is an example for quoted emails (under e.g. mutt).
-##
+
syntax "mutt"
+
+# Quoted lines.
color green "^>.*"
+
+# Signatures, even quoted ones.
+color yellow start="^>* ?-- $" end="^>* ?$"
diff --git a/doc/syntax/nanorc.nanorc b/doc/syntax/nanorc.nanorc
index 2c9f23a4..730b939f 100644
--- a/doc/syntax/nanorc.nanorc
+++ b/doc/syntax/nanorc.nanorc
@@ -1,16 +1,28 @@
## Here is an example for nanorc files.
-##
+
syntax "nanorc" "\.?nanorc$"
-## Possible errors and parameters
-icolor brightwhite "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
-## Keywords
-icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backupdir|backwards|boldtext|brackets|casesensitive|const|cut|fill|historylog|matchbrackets|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|operatingdir|poslog|preserve|punct)\>" "^[[:space:]]*(set|unset)[[:space:]]+(quickblank|quotestr|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|speller|suspend|suspendenable|tabsize|tabstospaces|tempfile|undo|view|whitespace|wordbounds|locking)\>"
-icolor green "^[[:space:]]*(set|unset|include|syntax|header|magic)\>"
-## Colors
+
+# Possible errors and parameters
+icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|linter|i?color|extendsyntax).*$"
+
+# Keywords
+icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backwards|boldtext|casesensitive|const|cut|fill|historylog|locking|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|poslog|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|suspend|tabsize|tabstospaces|tempfile|undo|view|wordbounds)\>"
+icolor yellow "^[[:space:]]*set[[:space:]]+(functioncolor|keycolor||statuscolor|titlecolor)[[:space:]]+(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
+icolor brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|functioncolor|keycolor|matchbrackets|operatingdir|punct|quotestr|speller|statuscolor|titlecolor|whitespace)[[:space:]]+"
+icolor brightgreen "^[[:space:]]*bind[[:space:]]+((\^|M-)([[:alpha:]]|space|[]]|[0-9_=+{}|;:'\",./<>\?-])|F([1-9]|1[0-6]))[[:space:]]+[[:alpha:]]+[[:space:]]+[[:alpha:]]+[[:space:]]*$"
+icolor brightgreen "^[[:space:]]*unbind[[:space:]]+((\^|M-)([[:alpha:]]|space|[]]|[0-9_=+{}|;:'\",./<>\?-])|F([1-9]|1[0-6]))[[:space:]]+[[:alpha:]]+[[:space:]]*$"
+icolor brightgreen "^[[:space:]]*extendsyntax[[:space:]]+[[:alpha:]]+[[:space:]]+(i?color|header|magic|linter)[[:space:]]+.*$"
+icolor green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|linter|extendsyntax)\>"
+
+# Colors
icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
-## Strings
-icolor white ""(\\.|[^"])*""
-## Comments
+
+# Strings
+icolor brightmagenta ""(\\.|[^"])*""
+# Comments
icolor brightblue "^[[:space:]]*#.*$"
icolor cyan "^[[:space:]]*##.*$"
+
+# Trailing whitespace
+color ,green "[[:space:]]+$"
diff --git a/doc/syntax/objc.nanorc b/doc/syntax/objc.nanorc
index cdf6e485..bfbae126 100644
--- a/doc/syntax/objc.nanorc
+++ b/doc/syntax/objc.nanorc
@@ -1,10 +1,9 @@
## Here is an example for C/C++/Obj-C.
-##
-syntax "m" "\.m$"
+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,30 +11,29 @@ color brightgreen "\<(for|if|while|do|else|case|default|switch)\>"
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 fc71ae23..8decb727 100644
--- a/doc/syntax/ocaml.nanorc
+++ b/doc/syntax/ocaml.nanorc
@@ -1,6 +1,7 @@
-# OCaml sample nanorc
-#
+## 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/patch.nanorc b/doc/syntax/patch.nanorc
index 5f101186..f5c1dd59 100644
--- a/doc/syntax/patch.nanorc
+++ b/doc/syntax/patch.nanorc
@@ -1,11 +1,21 @@
## Here is an example for patch files.
-##
+
syntax "patch" "\.(patch|diff)$"
magic "diff output text"
+
+# Added lines.
color brightgreen "^\+.*"
-color green "^\+\+\+.*"
+# Show trailing whitespace only on added lines.
+color ,green "[[:space:]]+$"
+# Context lines.
color brightblue "^ .*"
+# Deleted lines.
color brightred "^-.*"
+
+# File names and dates.
color red "^---.*"
+color green "^\+\+\+.*"
+# Line numbers.
color brightyellow "^@@.*"
+# Header lines.
color magenta "^diff.*"
diff --git a/doc/syntax/perl.nanorc b/doc/syntax/perl.nanorc
index 21acb145..5f39c176 100644
--- a/doc/syntax/perl.nanorc
+++ b/doc/syntax/perl.nanorc
@@ -1,8 +1,9 @@
## Here is an example for Perl.
-##
+
syntax "perl" "\.p[lm]$"
-magic "perl.*script text"
header "^#!.*/perl[-0-9._]*"
+magic "Perl script text"
+
color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>" "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>" "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>" "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>" "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
color magenta "\<(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\>"
icolor cyan start="[$@%]" end="( |[^0-9A-Z_]|-)"
diff --git a/doc/syntax/php.nanorc b/doc/syntax/php.nanorc
index 9cf54412..e3c4f1fa 100644
--- a/doc/syntax/php.nanorc
+++ b/doc/syntax/php.nanorc
@@ -1,31 +1,31 @@
-## Here is an example for PHP
-##
+## 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
new file mode 100644
index 00000000..567ef7ad
--- /dev/null
+++ b/doc/syntax/po.nanorc
@@ -0,0 +1,27 @@
+## Colouring for PO files.
+
+syntax "po" "\.pot?$"
+
+# Comments.
+color green "^#.*$"
+color yellow "Copyright|\(C\)"
+# Header fields.
+color brightmagenta "\<(Project\-Id\-Version|Report\-Msgid\-Bugs\-To|Last\-Translator|Language\-Team|Language|X\-Generator|Plural\-Forms)\>"
+color cyan "\<(POT\-Creation\-Date|PO\-Revision\-Date|MIME\-Version|Content\-Type|Content\-Transfer\-Encoding)\>"
+# Encodings and numbers.
+color yellow "\<(UTF|ISO|Windows|Mac|IBM)\>\-[0-9]"
+color yellow "[0-9]|pre[0-9]|[0-9]bit"
+# Msgids.
+color brightblue "\<(msgid|msgid_plural|msgstr)\>"
+# Tags.
+color red "\<fuzzy\>"
+color yellow "\<c-format\>"
+# Format specifiers.
+color brightmagenta "%([1-9]\$)?[a-z]*"
+# Quotes and newlines.
+color yellow "\""
+color cyan "\\n"
+# Reminders.
+color ,yellow "(FIXME|TODO|XXX)"
+# Obsolete strings.
+color red "#~.*$"
diff --git a/doc/syntax/pov.nanorc b/doc/syntax/pov.nanorc
index 298b2012..b7033b10 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 42802749..4679cf10 100644
--- a/doc/syntax/python.nanorc
+++ b/doc/syntax/python.nanorc
@@ -1,10 +1,24 @@
## Here is an example for Python.
-##
+
syntax "python" "\.py$"
header "^#!.*/python[-0-9._]*"
+
+# Function definitions.
icolor brightblue "def [0-9A-Z_]+"
+# Keywords.
color brightcyan "\<(and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield)\>"
+
+# Strings.
color brightgreen "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}"
color brightgreen "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
-color brightgreen start=""""[^"]" end=""""" start="'''[^']" end="'''"
-color brightred "#.*$"
+# Multiline strings.
+color brightgreen start="\"\"\"([^"),]|$)" end="(^|[^(])\"\"\""
+color brightgreen start="'''([^'),]|$)" end="(^|[^(])'''"
+
+# Comments.
+color brightred "(^|[[:blank:]])#.*$"
+# Reminders.
+color ,yellow "(FIXME|TODO|XXX)"
+
+# Trailing whitespace.
+color ,green "[[:space:]]+$"
diff --git a/doc/syntax/ruby.nanorc b/doc/syntax/ruby.nanorc
index b30b229d..3566e1fe 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 f6601057..823cc5d1 100644
--- a/doc/syntax/sh.nanorc
+++ b/doc/syntax/sh.nanorc
@@ -1,15 +1,27 @@
## 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 "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>"
-color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
+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 "[{}():;|`$<>!=&\\]" "(\]|\[)"
color green "-[Ldefgruwx]\>"
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
-color brightblue "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|install|let|ln|make|mkdir|mv|rm|sed|set|tar|touch|umask|unset)\>"
-icolor brightred "\$\{?[0-9A-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 f4afb1b3..a0fff88a 100644
--- a/doc/syntax/spec.nanorc
+++ b/doc/syntax/spec.nanorc
@@ -1,8 +1,8 @@
-# RPM spec files syntax highlighting
-# Parts taken from kate (KDE) syntax highlighting
-# Asterios Dramis
+## Syntax highlighting for RPM spec files.
+
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)"
-# Architectures 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/tcl.nanorc b/doc/syntax/tcl.nanorc
index ad3401fb..8bcec246 100644
--- a/doc/syntax/tcl.nanorc
+++ b/doc/syntax/tcl.nanorc
@@ -1,13 +1,15 @@
+## 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 ""(\\.|[^"])*"" "'(\\.|[^'])*'"
diff --git a/doc/syntax/tex.nanorc b/doc/syntax/tex.nanorc
index 23ca3a44..7fa417c4 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
new file mode 100644
index 00000000..63354bae
--- /dev/null
+++ b/doc/syntax/texinfo.nanorc
@@ -0,0 +1,20 @@
+## Here is an example for Texinfo files.
+
+syntax "texinfo" "\.texi$"
+header "^\\input texinfo"
+magic "Texinfo source text"
+
+# Command arguments, trailing and enclosed.
+color cyan "^@[a-z]+[[:space:]]+.*$"
+color brightmagenta "@[a-z]+\{[^}]*\}"
+# Commands themselves.
+color yellow "@[a-z]+\{?" "\}"
+
+# Menu items.
+color brightred "^\*[[:space:]]+.*::.*$"
+
+# Comments.
+color green "@c[[:space:]]+.*$"
+
+# Trailing whitespace.
+color ,green "[[:space:]]+$"
diff --git a/doc/syntax/xml.nanorc b/doc/syntax/xml.nanorc
index 9005d614..69982ea8 100644
--- a/doc/syntax/xml.nanorc
+++ b/doc/syntax/xml.nanorc
@@ -1,7 +1,8 @@
-## 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"
+magic "(XML|SGML) (sub)?document text"
+
color green start="<" end=">"
color cyan "<[^> ]+"
color cyan ">"