-
Notifications
You must be signed in to change notification settings - Fork 1
/
nanorc
69 lines (50 loc) · 1.69 KB
/
nanorc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#####################################################################
# Ruby syntax highlighting for Nano.
# Author: Josef 'Jupp' Schugt, jupp(a)rubyforge.org
# License: GPL 2 or later
# Version: 0.1 of 2004-02-20
#####################################################################
# Automatically use for '.rb' files
syntax "ruby" ".*\.*rb$"
# General
color white ".+"
# Operators
color brightyellow "::|\*\*|!|~|\*|/|%|\+|-|&|<<|>>|\|\^|>|>=|<|<="
color brightyellow "<=>|\||\|\||!=|=~|!~|&&|\+=|-=|=|\.\.|\.\.\."
color brightyellow "\<not\>|\<and\>|\<or\>"
# Keywords
color brightyellow "\<(BEGIN|END|alias|and|begin|break|case)\>"
color brightyellow "\<(class|def|defined|do|else|elsif|end)\>"
color brightyellow "\<(ensure|for|if|in|module|next|not|or|redo)\>"
color brightyellow "\<(rescue|retry|return|self|super|then|undef)\>"
color brightyellow "\<(unless|until|when|while|yield)\>"
# false, nil, true
color magenta "\<(false|nil|true)\>"
# Above must not match 'nil?'
color white "\<nil\?"
# external stuff
color brightgreen "\<(load|require|%q|%!|%Q|%r|%x)"
# Iterators
color brightgreen "\|\w*\|"
# Constants
color yellow "\<[A-Z]\w*\>"
# Symbols
color yellow "([ \t]|^):(@|@@|\$)?\w+\>"
# Strings
color green "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'"
# Backticks
color green "`(\\.|[^\\\"])*`"
# Regular expressions
color green "/(\\.|[^\\/])*/[imox]*"
# Escapes
color red "\\[0-7][0-7][0-7]|\\x[0-9a-fA-F][0-9a-fA-F]"
color red "\\[abefnrs]"
color red "(\\c|\\C-|\\M-|\\M-\\C-)."
# Expression substitution
color red "#{[^}]*}|#(@|@@|\$)\w+"
# Simple comments
color cyan "#([^{].*)?$"
# Shebang
color brightcyan "^#!.*"
# Multiline comments
color cyan start="^=begin" end="^=end"