nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit badf3edc5583525e09457e8720c9c81a169e42b5
parent 36e328497908159af5e4240457e6501d849f9e60
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 15 Oct 2021 17:24:18 +0200

syntax: texinfo: colorize the special @-plus-punctuation commands too

Also, allow an @} and another @command{} within a pair of braces,
colorize only the valid @-commands with uppercase in their names,
unbold enclosed command arguments, colorize the directory entries
for the manual, and properly colorize also the comments that use
the full @comment command.

Reference:
  https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Command-List.html

Testing was done with:
  info texinfo @-C "Command List" --output=list
  sed -i -e "s/^'//" -e "s/'$//" list
  nano list -Ytexinfo

Diffstat:
Msyntax/texinfo.nanorc | 13++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/syntax/texinfo.nanorc b/syntax/texinfo.nanorc @@ -8,17 +8,24 @@ header "^\\input texinfo" magic "Texinfo source" comment "@c " +# How the manual gets listed in the directory node. +color purple start="^@direntry" end="^@end direntry" + # Command arguments, trailing and enclosed. color cyan "^@[a-z]+[[:space:]]+.*" -color brightmagenta "@[a-zA-Z]+\{[^}]*\}" +color lightmagenta "@([a-z]+|,|H|U)\{([^}]|@\}|@[a-z]+\{[^}]*\})*\}" # Commands themselves. -color yellow "@[a-zA-Z]+\{?|\}" +color yellow "@([a-z]+\{?|[,HU]\{|(AA|AE|DH|L|OE?|(La)?TeX|TH)\{)|\}" +color pink "@[!"'&*./:=?@\^`{}~-]" + +# Special separator for headings and footings. +color mint "@\|" # Menu items. color brightred "^\*[[:space:]]+.*::.*" # Comments. -color green "@c[[:space:]]+.*" +color green "@c(omment)?[[:space:]]+.*" # Trailing whitespace. color ,green "[[:space:]]+$"