[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] Syntax examples

From: Robert D. Goulding
Subject: [Nano-devel] Syntax examples
Date: Tue, 7 Jan 2003 22:36:53 -0500 (EST)

If you're looking for syntax examples, you're welcome to use mine, for
what they're worth.  Here are my patterns for GNU troff and nanorc (!):


syntax "groff" "\.ms$" "\.mm$" "\.me$" "\.tmac$" "^tmac." ".rof"
# The argument of .nr or .ds
color cyan "^\.ds [^ ]*"
color cyan "^\.nr [^ ]*"
# Single character escapes
color brightmagenta "\\."
# Highlight the argument of \f or \s in the same colour
color brightmagenta "\\f."
color brightmagenta "\\f\(.."
color brightmagenta "\\s(\+|\-)?[0-9]"
# \n
color cyan "(\\|\\\\)n."
color cyan "(\\|\\\\)n\(.."
color cyan start="(\\|\\\\)n\[" end="]"
# Requests
color brightgreen "^\. *[^ ]*"
# Comments
color yellow "^\.\\\".*$"
# Strings
color green "(\\|\\\\)\*."
color green "(\\|\\\\)\*\(.."
color green start="(\\|\\\\)\*\[" end="]"
# Characters
color brightred "\\\(.."
color brightred start="\\\[" end="]"
# Macro arguments
color brightcyan "\\\\\$[1-9]"

syntax "nanorc" "nanorc"
color white "^ *(set|unset).*$"
color cyan "^ *(set|unset) 
color brightwhite "^ *syntax [^ ]*"
color brightblue "^ *set\>" "^ *unset\>" "^ *syntax\>"
color white "^ *color\>.*"
color green "^ *color [^ ]*"
color magenta "^ *color\>"
color yellow "^#.*$"

Robert Goulding
Society of Fellows
Joseph Henry House
Princeton NJ 08544

reply via email to

[Prev in Thread] Current Thread [Next in Thread]