2006-06-01 17:23:28 +00:00
## Here is an example for Ruby.
2014-05-16 20:21:34 +00:00
2006-06-01 17:23:28 +00:00
syntax "ruby" "\.rb$"
2014-09-21 15:29:40 +00:00
header "^#!.*ruby[-0-9._]*"
2015-04-18 11:35:23 +00:00
linter ruby -w -c
2016-05-25 20:13:50 +00:00
comment "#"
2014-05-16 20:21:34 +00:00
2015-02-21 10:34:15 +00:00
# Reserved words.
color yellow "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module)\>"
color yellow "\<(next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\>"
2014-05-16 20:21:34 +00:00
# Constants.
2006-07-07 13:54:38 +00:00
color brightblue "(\$|@|@@)?\<[A-Z]+[0-9A-Z_a-z]*"
2014-05-16 20:21:34 +00:00
# Ruby "symbols".
2006-06-01 17:23:28 +00:00
icolor magenta "([ ]|^):[0-9A-Z_]+\>"
2014-05-16 20:21:34 +00:00
# Some unique things we want to stand out.
2006-06-01 17:23:28 +00:00
color brightyellow "\<(__FILE__|__LINE__)\>"
2014-05-16 20:21:34 +00:00
# Regular expressions.
2006-06-01 17:23:28 +00:00
color brightmagenta "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
2014-05-16 20:21:34 +00:00
# Shell command expansion is in `backticks` or like %x{this}. These are
# "double-quotish" (to use a perlism).
2006-06-01 17:23:28 +00:00
color brightblue "`[^`]*`" "%x\{[^}]*\}"
2014-05-16 20:21:34 +00:00
# Strings, double-quoted.
2006-06-01 17:23:28 +00:00
color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
2014-05-16 20:21:34 +00:00
# Expression substitution. These go inside double-quoted strings,
# "like #{this}".
2006-06-01 17:23:28 +00:00
color brightgreen "#\{[^}]*\}"
2014-05-16 20:21:34 +00:00
# Strings, single-quoted.
2006-06-01 17:23:28 +00:00
color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
2014-05-16 20:21:34 +00:00
# Comments.
2006-06-01 17:23:28 +00:00
color cyan "#[^{].*$" "#$"
color brightcyan "##[^{].*$" "##$"
2014-05-16 20:21:34 +00:00
# "Here" docs.
2006-06-08 12:49:57 +00:00
color green start="<<-?'?EOT'?" end="^EOT"
2014-05-16 20:21:34 +00:00
# Some common markers.
2006-06-01 17:23:28 +00:00
color brightcyan "(XXX|TODO|FIXME|\?\?\?)"