]> git.lizzy.rs Git - micro.git/blob - syntax_files/ruby.micro
Proper window resize handling
[micro.git] / syntax_files / ruby.micro
1 ## Here is an example for Ruby.
2 ##
3 syntax "Ruby" "\.rb$" "Gemfile" "config.ru" "Rakefile" "Capfile" "Vagrantfile"
4 header "^#!.*/(env +)?ruby( |$)"
5
6 ## Asciibetical list of reserved words
7 color statement "\b(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)\b"
8 ## Constants
9 color constant "(\$|@|@@)?\b[A-Z]+[0-9A-Z_a-z]*"
10 ## Ruby "symbols"
11 color constant (i) "([  ]|^):[0-9A-Z_]+\b"
12 ## Some unique things we want to stand out
13 color constant "\b(__FILE__|__LINE__)\b"
14 ## Regular expressions
15 color constant "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*"
16 ## Shell command expansion is in `backticks` or like %x{this}.  These are
17 ## "double-quotish" (to use a perlism).
18 color constant "`[^`]*`" "%x\{[^}]*\}"
19 ## Strings, double-quoted
20 color constant ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!"
21 ## Expression substitution.  These go inside double-quoted strings,
22 ## "like #{this}".
23 color special "#\{[^}]*\}"
24 ## Strings, single-quoted
25 color constant "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!"
26 ## Comments
27 color comment "#[^{].*$" "#$"
28 color comment "##[^{].*$" "##$"
29 ## "Here" docs
30 color constant (s) "<<-?'?EOT'?.*?^EOT"
31 ## Some common markers
32 color todo "(XXX|TODO|FIXME|\?\?\?)"
33