utils 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +68 -0
- data/VERSION +1 -0
- data/bin/chroot-exec +12 -0
- data/bin/chroot-libs +18 -0
- data/bin/classify +37 -0
- data/bin/discover +137 -0
- data/bin/edit +74 -0
- data/bin/errf +32 -0
- data/bin/git-empty +8 -0
- data/bin/myex +90 -0
- data/bin/number_files +26 -0
- data/bin/same_files +37 -0
- data/bin/search +205 -0
- data/bin/sedit +3 -0
- data/bin/sshscreen +68 -0
- data/bin/term +21 -0
- data/bin/unquarantine_apps +8 -0
- data/bin/untest +17 -0
- data/bin/utils-install-config +10 -0
- data/bin/vacuum_firefox_sqlite +22 -0
- data/bin/xmp +74 -0
- data/lib/utils.rb +8 -0
- data/lib/utils/config.rb +23 -0
- data/lib/utils/config/gdb/asm +179 -0
- data/lib/utils/config/gdb/ruby +528 -0
- data/lib/utils/config/gdbinit +8 -0
- data/lib/utils/config/irbrc +455 -0
- data/lib/utils/config/rdebugrc +2 -0
- data/lib/utils/config/screenrc +143 -0
- data/lib/utils/config/vim/autoload/Align.vim +1029 -0
- data/lib/utils/config/vim/autoload/AlignMaps.vim +330 -0
- data/lib/utils/config/vim/autoload/rails.vim +4744 -0
- data/lib/utils/config/vim/autoload/rubycomplete.vim +801 -0
- data/lib/utils/config/vim/autoload/sqlcomplete.vim +741 -0
- data/lib/utils/config/vim/autoload/vimball.vim +750 -0
- data/lib/utils/config/vim/colors/flori.vim +113 -0
- data/lib/utils/config/vim/compiler/eruby.vim +40 -0
- data/lib/utils/config/vim/compiler/ruby.vim +67 -0
- data/lib/utils/config/vim/compiler/rubyunit.vim +34 -0
- data/lib/utils/config/vim/ftdetect/ragel.vim +2 -0
- data/lib/utils/config/vim/ftdetect/ruby.vim +17 -0
- data/lib/utils/config/vim/ftplugin/eruby.vim +100 -0
- data/lib/utils/config/vim/ftplugin/ruby.vim +260 -0
- data/lib/utils/config/vim/ftplugin/xml.vim +941 -0
- data/lib/utils/config/vim/indent/IndentAnything_html.vim +35 -0
- data/lib/utils/config/vim/indent/eruby.vim +77 -0
- data/lib/utils/config/vim/indent/javascript.vim +116 -0
- data/lib/utils/config/vim/indent/ruby.vim +377 -0
- data/lib/utils/config/vim/plugin/AlignMapsPlugin.vim +242 -0
- data/lib/utils/config/vim/plugin/AlignPlugin.vim +41 -0
- data/lib/utils/config/vim/plugin/Decho.vim +592 -0
- data/lib/utils/config/vim/plugin/IndentAnything.vim +675 -0
- data/lib/utils/config/vim/plugin/bufexplorer.vim +1144 -0
- data/lib/utils/config/vim/plugin/cecutil.vim +482 -0
- data/lib/utils/config/vim/plugin/fugitive.vim +1703 -0
- data/lib/utils/config/vim/plugin/lusty-explorer.vim +1509 -0
- data/lib/utils/config/vim/plugin/rails.vim +340 -0
- data/lib/utils/config/vim/plugin/rubyextra.vim +193 -0
- data/lib/utils/config/vim/plugin/surround.vim +628 -0
- data/lib/utils/config/vim/plugin/taglist.vim +4546 -0
- data/lib/utils/config/vim/plugin/test/IndentAnything/test.js +131 -0
- data/lib/utils/config/vim/plugin/vimballPlugin.vim +40 -0
- data/lib/utils/config/vim/syntax/Decho.vim +101 -0
- data/lib/utils/config/vim/syntax/eruby.vim +73 -0
- data/lib/utils/config/vim/syntax/javascript.vim +246 -0
- data/lib/utils/config/vim/syntax/ragel.vim +165 -0
- data/lib/utils/config/vim/syntax/ruby.vim +367 -0
- data/lib/utils/config/vimrc +461 -0
- data/lib/utils/file.rb +49 -0
- data/lib/utils/find.rb +54 -0
- data/lib/utils/md5.rb +23 -0
- data/lib/utils/patterns.rb +34 -0
- data/lib/utils/version.rb +8 -0
- data/utils.gemspec +33 -0
- metadata +183 -0
@@ -0,0 +1,165 @@
|
|
1
|
+
" Vim syntax file
|
2
|
+
"
|
3
|
+
" Language: Ragel
|
4
|
+
" Author: Adrian Thurston
|
5
|
+
|
6
|
+
syntax clear
|
7
|
+
|
8
|
+
"
|
9
|
+
" Outside code
|
10
|
+
"
|
11
|
+
|
12
|
+
" Comments
|
13
|
+
syntax region ocComment start="\/\*" end="\*\/"
|
14
|
+
syntax match ocComment "\/\/.*$"
|
15
|
+
|
16
|
+
" Anything preprocessor
|
17
|
+
syntax match ocPreproc "#.*$"
|
18
|
+
|
19
|
+
" Strings
|
20
|
+
syntax match ocLiteral "'\(\\.\|[^'\\]\)*'"
|
21
|
+
syntax match ocLiteral "\"\(\\.\|[^\"\\]\)*\""
|
22
|
+
|
23
|
+
" C/C++ Keywords
|
24
|
+
syntax keyword ocType unsigned signed void char short int long float double bool
|
25
|
+
syntax keyword ocType inline static extern register const volatile auto
|
26
|
+
syntax keyword ocType union enum struct class typedef
|
27
|
+
syntax keyword ocType namespace template typename mutable
|
28
|
+
syntax keyword ocKeyword break continue default do else for
|
29
|
+
syntax keyword ocKeyword goto if return switch while
|
30
|
+
syntax keyword ocKeyword new delete this using friend public private protected sizeof
|
31
|
+
syntax keyword ocKeyword throw try catch operator typeid
|
32
|
+
syntax keyword ocKeyword and bitor xor compl bitand and_eq or_eq xor_eq not not_eq
|
33
|
+
syntax keyword ocKeyword static_cast dynamic_cast
|
34
|
+
|
35
|
+
" D Keywords
|
36
|
+
syntax keyword ocType wchar dchar bit byte ubyte ushort uint ulong cent ucent
|
37
|
+
syntax keyword ocType cfloat ifloat cdouble idouble real creal ireal
|
38
|
+
syntax keyword ocKeyword abstract alias align asm assert body cast debug delegate
|
39
|
+
syntax keyword ocKeyword deprecated export final finally foreach function import in inout
|
40
|
+
syntax keyword ocKeyword interface invariant is mixin module out override package pragma
|
41
|
+
syntax keyword ocKeyword super synchronized typeof unittest version with
|
42
|
+
|
43
|
+
" Java Keywords
|
44
|
+
syntax keyword ocType byte short char int
|
45
|
+
|
46
|
+
" Objective-C Directives
|
47
|
+
syntax match ocKeyword "@public\|@private\|@protected"
|
48
|
+
syntax match ocKeyword "@interface\|@implementation"
|
49
|
+
syntax match ocKeyword "@class\|@end\|@defs"
|
50
|
+
syntax match ocKeyword "@encode\|@protocol\|@selector"
|
51
|
+
|
52
|
+
" Numbers
|
53
|
+
syntax match ocNumber "[0-9][0-9]*"
|
54
|
+
syntax match ocNumber "0x[0-9a-fA-F][0-9a-fA-F]*"
|
55
|
+
|
56
|
+
" Booleans
|
57
|
+
syntax keyword ocBoolean true false
|
58
|
+
|
59
|
+
" Identifiers
|
60
|
+
syntax match anyId "[a-zA-Z_][a-zA-Z_0-9]*"
|
61
|
+
|
62
|
+
" Inline code only
|
63
|
+
syntax keyword fsmType fpc fc fcurs fbuf fblen ftargs fstack
|
64
|
+
syntax keyword fsmKeyword fhold fgoto fcall fret fentry fnext fexec fbreak
|
65
|
+
|
66
|
+
syntax cluster rlItems contains=rlComment,rlLiteral,rlAugmentOps,rlOtherOps,rlKeywords,rlWrite,rlCodeCurly,rlCodeSemi,rlNumber,anyId,rlLabelColon,rlExprKeywords
|
67
|
+
|
68
|
+
syntax region machineSpec1 matchgroup=beginRL start="%%{" end="}%%" contains=@rlItems
|
69
|
+
syntax region machineSpec2 matchgroup=beginRL start="%%[^{]"rs=e-1 end="$" keepend contains=@rlItems
|
70
|
+
syntax region machineSpec2 matchgroup=beginRL start="%%$" end="$" keepend contains=@rlItems
|
71
|
+
|
72
|
+
" Comments
|
73
|
+
syntax match rlComment "#.*$" contained
|
74
|
+
|
75
|
+
" Literals
|
76
|
+
syntax match rlLiteral "'\(\\.\|[^'\\]\)*'[i]*" contained
|
77
|
+
syntax match rlLiteral "\"\(\\.\|[^\"\\]\)*\"[i]*" contained
|
78
|
+
syntax match rlLiteral /\/\(\\.\|[^\/\\]\)*\/[i]*/ contained
|
79
|
+
syntax match rlLiteral "\[\(\\.\|[^\]\\]\)*\]" contained
|
80
|
+
|
81
|
+
" Numbers
|
82
|
+
syntax match rlNumber "[0-9][0-9]*" contained
|
83
|
+
syntax match rlNumber "0x[0-9a-fA-F][0-9a-fA-F]*" contained
|
84
|
+
|
85
|
+
" Operators
|
86
|
+
syntax match rlAugmentOps "[>$%@]" contained
|
87
|
+
syntax match rlAugmentOps "<>\|<" contained
|
88
|
+
syntax match rlAugmentOps "[>\<$%@][!\^/*~]" contained
|
89
|
+
syntax match rlAugmentOps "[>$%]?" contained
|
90
|
+
syntax match rlAugmentOps "<>[!\^/*~]" contained
|
91
|
+
syntax match rlAugmentOps "=>" contained
|
92
|
+
syntax match rlOtherOps "->" contained
|
93
|
+
|
94
|
+
syntax match rlOtherOps ":>" contained
|
95
|
+
syntax match rlOtherOps ":>>" contained
|
96
|
+
syntax match rlOtherOps "<:" contained
|
97
|
+
|
98
|
+
" Keywords
|
99
|
+
" FIXME: Enable the range keyword post 5.17.
|
100
|
+
" syntax keyword rlKeywords machine action context include range contained
|
101
|
+
syntax keyword rlKeywords machine action context include contained
|
102
|
+
syntax keyword rlExprKeywords when err lerr eof from to contained
|
103
|
+
|
104
|
+
" Case Labels
|
105
|
+
syntax keyword caseLabelKeyword case contained
|
106
|
+
syntax cluster caseLabelItems contains=ocComment,ocPreproc,ocLiteral,ocType,ocKeyword,caseLabelKeyword,ocNumber,ocBoolean,anyId,fsmType,fsmKeyword
|
107
|
+
syntax match caseLabelColon "case" contains=@caseLabelItems
|
108
|
+
syntax match caseLabelColon "case[\t ]\+.*:$" contains=@caseLabelItems
|
109
|
+
syntax match caseLabelColon "case[\t ]\+.*:[^=:]"me=e-1 contains=@caseLabelItems
|
110
|
+
|
111
|
+
" Labels
|
112
|
+
syntax match ocLabelColon "^[\t ]*[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:$" contains=anyLabel
|
113
|
+
syntax match ocLabelColon "^[\t ]*[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:[^=:]"me=e-1 contains=anyLabel
|
114
|
+
|
115
|
+
syntax match rlLabelColon "[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:$" contained contains=anyLabel
|
116
|
+
syntax match rlLabelColon "[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:[^=:>]"me=e-1 contained contains=anyLabel
|
117
|
+
syntax match anyLabel "[a-zA-Z_][a-zA-Z_0-9]*" contained
|
118
|
+
|
119
|
+
" All items that can go in a code block.
|
120
|
+
|
121
|
+
syntax cluster inlineItems contains=rlCodeCurly,ocComment,ocPreproc,ocLiteral,ocType,ocKeyword,ocNumber,ocBoolean,ocLabelColon,anyId,fsmType,fsmKeyword,caseLabelColon
|
122
|
+
|
123
|
+
" Blocks of code. rlCodeCurly is recursive.
|
124
|
+
syntax region rlCodeCurly matchgroup=NONE start="{" end="}" contained contains=@inlineItems
|
125
|
+
syntax region rlCodeSemi matchgroup=Type start="\<alphtype\>" start="\<getkey\>" start="\<access\>" start="\<variable\>" matchgroup=NONE end=";" contained contains=@inlineItems
|
126
|
+
|
127
|
+
syntax region rlWrite matchgroup=Type start="\<write\>" matchgroup=NONE end=";" contained contains=rlWriteKeywords,rlWriteOptions
|
128
|
+
|
129
|
+
syntax keyword rlWriteKeywords init data exec eof contained
|
130
|
+
syntax keyword rlWriteOptions noerror nofinal noprefix noend contained
|
131
|
+
|
132
|
+
"
|
133
|
+
" Sync at the start of machine specs.
|
134
|
+
"
|
135
|
+
" Match The ragel delimiters only if there quotes no ahead on the same line.
|
136
|
+
" On the open marker, use & to consume the leader.
|
137
|
+
syntax sync match ragelSyncPat grouphere NONE "^[^\'\"%]*%%{&^[^\'\"%]*"
|
138
|
+
syntax sync match ragelSyncPat grouphere NONE "^[^\'\"%]*%%[^{]&^[^\'\"%]*"
|
139
|
+
syntax sync match ragelSyncPat grouphere NONE "^[^\'\"]*}%%"
|
140
|
+
|
141
|
+
"
|
142
|
+
" Specifying Groups
|
143
|
+
"
|
144
|
+
hi link ocComment Comment
|
145
|
+
hi link ocPreproc Macro
|
146
|
+
hi link ocLiteral String
|
147
|
+
hi link ocType Type
|
148
|
+
hi link ocKeyword Keyword
|
149
|
+
hi link ocNumber Number
|
150
|
+
hi link ocBoolean Boolean
|
151
|
+
hi link rlComment Comment
|
152
|
+
hi link rlNumber Number
|
153
|
+
hi link rlLiteral String
|
154
|
+
hi link rlAugmentOps Keyword
|
155
|
+
hi link rlExprKeywords Keyword
|
156
|
+
hi link rlWriteKeywords Keyword
|
157
|
+
hi link rlWriteOptions Keyword
|
158
|
+
hi link rlKeywords Type
|
159
|
+
hi link fsmType Type
|
160
|
+
hi link fsmKeyword Keyword
|
161
|
+
hi link anyLabel Label
|
162
|
+
hi link caseLabelKeyword Keyword
|
163
|
+
hi link beginRL Type
|
164
|
+
|
165
|
+
let b:current_syntax = "ragel"
|
@@ -0,0 +1,367 @@
|
|
1
|
+
" Vim syntax file
|
2
|
+
" Language: Ruby
|
3
|
+
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
4
|
+
" URL: http://vim-ruby.rubyforge.org
|
5
|
+
" Anon CVS: See above site
|
6
|
+
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
7
|
+
" ----------------------------------------------------------------------------
|
8
|
+
"
|
9
|
+
" Previous Maintainer: Mirko Nasato
|
10
|
+
" Thanks to perl.vim authors, and to Reimer Behrends. :-) (MN)
|
11
|
+
" ----------------------------------------------------------------------------
|
12
|
+
|
13
|
+
if exists("b:current_syntax")
|
14
|
+
finish
|
15
|
+
endif
|
16
|
+
|
17
|
+
if has("folding") && exists("ruby_fold")
|
18
|
+
setlocal foldmethod=syntax
|
19
|
+
endif
|
20
|
+
|
21
|
+
syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo
|
22
|
+
|
23
|
+
if exists("ruby_space_errors")
|
24
|
+
if !exists("ruby_no_trail_space_error")
|
25
|
+
syn match rubySpaceError display excludenl "\s\+$"
|
26
|
+
endif
|
27
|
+
if !exists("ruby_no_tab_space_error")
|
28
|
+
syn match rubySpaceError display " \+\t"me=e-1
|
29
|
+
endif
|
30
|
+
endif
|
31
|
+
|
32
|
+
" Operators
|
33
|
+
if exists("ruby_operators")
|
34
|
+
syn match rubyOperator "\%([~!^&|*/%+-]\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::\)"
|
35
|
+
syn match rubyPseudoOperator "\%(-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=\)"
|
36
|
+
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop
|
37
|
+
endif
|
38
|
+
|
39
|
+
" Expression Substitution and Backslash Notation
|
40
|
+
syn match rubyStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display
|
41
|
+
syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display
|
42
|
+
syn match rubyQuoteEscape "\\[\\']" contained display
|
43
|
+
|
44
|
+
syn region rubyInterpolation matchgroup=rubyInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,@rubyNotTop
|
45
|
+
syn match rubyInterpolation "#\%(\$\|@@\=\)\w\+" display contained contains=rubyInterpolationDelimiter,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable,rubyPredefinedVariable
|
46
|
+
syn match rubyInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained
|
47
|
+
syn match rubyInterpolation "#\$\%(-\w\|\W\)" display contained contains=rubyInterpolationDelimiter,rubyPredefinedVariable,rubyInvalidVariable
|
48
|
+
syn match rubyInterpolationDelimiter "#\ze\$\%(-\w\|\W\)" display contained
|
49
|
+
syn region rubyNoInterpolation start="\\#{" end="}" contained
|
50
|
+
syn match rubyNoInterpolation "\\#{" display contained
|
51
|
+
syn match rubyNoInterpolation "\\#\%(\$\|@@\=\)\w\+" display contained
|
52
|
+
syn match rubyNoInterpolation "\\#\$\W" display contained
|
53
|
+
|
54
|
+
syn match rubyDelimEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE
|
55
|
+
|
56
|
+
syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained
|
57
|
+
syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained
|
58
|
+
syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained
|
59
|
+
syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained
|
60
|
+
|
61
|
+
" These are mostly Oniguruma ready
|
62
|
+
syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\)" end=")" contained
|
63
|
+
syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\)" end=")" contained transparent contains=@rubyRegexpSpecial
|
64
|
+
syn region rubyRegexpBrackets matchgroup=rubyRegexpCharClass start="\[\^\=" skip="\\\]" end="\]" contained transparent contains=rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass oneline
|
65
|
+
syn match rubyRegexpCharClass "\\[DdHhSsWw]" contained display
|
66
|
+
syn match rubyRegexpCharClass "\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\):\]" contained
|
67
|
+
syn match rubyRegexpEscape "\\[].*?+^$|\\/(){}[]" contained display
|
68
|
+
syn match rubyRegexpQuantifier "[*?+][?+]\=" contained display
|
69
|
+
syn match rubyRegexpQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display
|
70
|
+
syn match rubyRegexpAnchor "[$^]\|\\[ABbGZz]" contained display
|
71
|
+
syn match rubyRegexpDot "\." contained display
|
72
|
+
syn match rubyRegexpSpecial "|" contained display
|
73
|
+
syn match rubyRegexpSpecial "\\[1-9]\d\=\d\@!" contained display
|
74
|
+
syn match rubyRegexpSpecial "\\k<\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\=>" contained display
|
75
|
+
syn match rubyRegexpSpecial "\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" contained display
|
76
|
+
syn match rubyRegexpSpecial "\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display
|
77
|
+
syn match rubyRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display
|
78
|
+
|
79
|
+
syn cluster rubyStringSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape
|
80
|
+
syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets
|
81
|
+
syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment
|
82
|
+
|
83
|
+
" Numbers and ASCII Codes
|
84
|
+
syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)"
|
85
|
+
syn match rubyInteger "\<0[xX]\x\+\%(_\x\+\)*\>" display
|
86
|
+
syn match rubyInteger "\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)\>" display
|
87
|
+
syn match rubyInteger "\<0[oO]\=\o\+\%(_\o\+\)*\>" display
|
88
|
+
syn match rubyInteger "\<0[bB][01]\+\%(_[01]\+\)*\>" display
|
89
|
+
syn match rubyFloat "\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*\>" display
|
90
|
+
syn match rubyFloat "\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)\>" display
|
91
|
+
|
92
|
+
" Identifiers
|
93
|
+
syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
|
94
|
+
syn match rubyBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent
|
95
|
+
|
96
|
+
syn match rubyConstant "\%(\%([.@$]\@<!\.\)\@<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=\%(\s*(\)\@!"
|
97
|
+
syn match rubyClassVariable "@@\h\w*" display
|
98
|
+
syn match rubyInstanceVariable "@\h\w*" display
|
99
|
+
syn match rubyGlobalVariable "$\%(\h\w*\|-.\)"
|
100
|
+
syn match rubySymbol "[]})\"':]\@<!:\%(\^\|\~\|<<\|<=>\|<=\|<\|===\|==\|=\~\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)"
|
101
|
+
syn match rubySymbol "[]})\"':]\@<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)"
|
102
|
+
syn match rubySymbol "[]})\"':]\@<!:\%(\$\|@@\=\)\=\h\w*"
|
103
|
+
syn match rubySymbol "[]})\"':]\@<!:\h\w*\%([?!=]>\@!\)\="
|
104
|
+
syn match rubySymbol "[]})\"':]\@<!\h\w*\%([?!=]>\@!\)\=:"
|
105
|
+
syn region rubySymbol start="[]})\"':]\@<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
|
106
|
+
syn region rubySymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
|
107
|
+
|
108
|
+
syn match rubyBlockParameter "\h\w*" contained
|
109
|
+
syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\s*\)\@<=|" end="|" oneline display contains=rubyBlockParameter
|
110
|
+
|
111
|
+
syn match rubyInvalidVariable "$[^ A-Za-z_-]"
|
112
|
+
syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~1-9]#
|
113
|
+
syn match rubyPredefinedVariable "$_\>" display
|
114
|
+
syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display
|
115
|
+
syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display
|
116
|
+
syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display
|
117
|
+
syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(MatchingData\|ARGF\|ARGV\|ENV\)\>\%(\s*(\)\@!"
|
118
|
+
syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(DATA\|FALSE\|NIL\|RUBY_PLATFORM\|RUBY_RELEASE_DATE\)\>\%(\s*(\)\@!"
|
119
|
+
syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(RUBY_VERSION\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>\%(\s*(\)\@!"
|
120
|
+
"Obsolete Global Constants
|
121
|
+
"syn match rubyPredefinedConstant "\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>"
|
122
|
+
"syn match rubyPredefinedConstant "\%(::\)\=\zs\%(NotImplementError\)\>"
|
123
|
+
|
124
|
+
" Normal Regular Expression
|
125
|
+
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[>]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial keepend fold
|
126
|
+
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold
|
127
|
+
|
128
|
+
" Generalized Regular Expression
|
129
|
+
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold
|
130
|
+
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold
|
131
|
+
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
|
132
|
+
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold
|
133
|
+
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold
|
134
|
+
|
135
|
+
" Normal String and Shell Command Output
|
136
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
|
137
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
|
138
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold
|
139
|
+
|
140
|
+
" Generalized Single Quoted String, Symbol and Array of Strings
|
141
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
142
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
|
143
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
|
144
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
|
145
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
|
146
|
+
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
147
|
+
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
|
148
|
+
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
|
149
|
+
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
|
150
|
+
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
|
151
|
+
|
152
|
+
" Generalized Double Quoted String and Array of Strings and Shell Command Output
|
153
|
+
" Note: %= is not matched here as the beginning of a double quoted string
|
154
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
155
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
156
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold
|
157
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
|
158
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold
|
159
|
+
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
|
160
|
+
|
161
|
+
" Here Document
|
162
|
+
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\h\w*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
163
|
+
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
164
|
+
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
165
|
+
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
166
|
+
|
167
|
+
syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<\z(\h\w*\)\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
168
|
+
syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<"\z([^"]*\)"\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
169
|
+
syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<'\z([^']*\)'\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart fold keepend
|
170
|
+
syn region rubyString start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<`\z([^`]*\)`\ze+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
171
|
+
|
172
|
+
syn region rubyString start=+\%(\%(class\s*\|\%([]}).]\|::\)\)\_s*\|\w\)\@<!<<-\z(\h\w*\)\ze+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
173
|
+
syn region rubyString start=+\%(\%(class\s*\|\%([]}).]\|::\)\)\_s*\|\w\)\@<!<<-"\z([^"]*\)"\ze+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
174
|
+
syn region rubyString start=+\%(\%(class\s*\|\%([]}).]\|::\)\)\_s*\|\w\)\@<!<<-'\z([^']*\)'\ze+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart fold keepend
|
175
|
+
syn region rubyString start=+\%(\%(class\s*\|\%([]}).]\|::\)\)\_s*\|\w\)\@<!<<-`\z([^`]*\)`\ze+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
176
|
+
|
177
|
+
if exists('main_syntax') && main_syntax == 'eruby'
|
178
|
+
let b:ruby_no_expensive = 1
|
179
|
+
end
|
180
|
+
|
181
|
+
syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable nextgroup=rubyAliasDeclaration2 skipwhite
|
182
|
+
syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable
|
183
|
+
syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable
|
184
|
+
syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator
|
185
|
+
syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator
|
186
|
+
syn match rubyFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:].:?!=]\@!" contained containedin=rubyMethodDeclaration
|
187
|
+
syn match rubyFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2
|
188
|
+
syn match rubyFunction "\%([[:space:].]\|^\)\@<=\%(\[\]=\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|==\|=\~\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration
|
189
|
+
|
190
|
+
syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter
|
191
|
+
|
192
|
+
" Keywords
|
193
|
+
" Note: the following keywords have already been defined:
|
194
|
+
" begin case class def do end for if module unless until while
|
195
|
+
syn match rubyControl "\<\%(and\|break\|in\|next\|not\|or\|redo\|rescue\|retry\|return\)\>[?!]\@!"
|
196
|
+
syn match rubyOperator "\<defined?" display
|
197
|
+
syn match rubyKeyword "\<\%(super\|yield\)\>[?!]\@!"
|
198
|
+
syn match rubyBoolean "\<\%(true\|false\)\>[?!]\@!"
|
199
|
+
syn match rubyPseudoVariable "\<\%(nil\|self\|__FILE__\|__LINE__\)\>[?!]\@!"
|
200
|
+
syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>[?!]\@!"
|
201
|
+
|
202
|
+
" Expensive Mode - match 'end' with the appropriate opening keyword for syntax
|
203
|
+
" based folding and special highlighting of module/class/method definitions
|
204
|
+
if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
|
205
|
+
syn match rubyDefine "\<alias\>" nextgroup=rubyAliasDeclaration skipwhite skipnl
|
206
|
+
syn match rubyDefine "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl
|
207
|
+
syn match rubyDefine "\<undef\>" nextgroup=rubyFunction skipwhite skipnl
|
208
|
+
syn match rubyClass "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl
|
209
|
+
syn match rubyModule "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl
|
210
|
+
syn region rubyMethod start="\<def\>" matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold
|
211
|
+
syn region rubyBlock start="\<class\>" matchgroup=rubyClass end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
212
|
+
syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
213
|
+
|
214
|
+
" modifiers
|
215
|
+
syn match rubyConditionalModifier "\<\%(if\|unless\)\>" display
|
216
|
+
syn match rubyRepeatModifier "\<\%(while\|until\)\>" display
|
217
|
+
|
218
|
+
syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
219
|
+
" curly bracket block or hash literal
|
220
|
+
syn region rubyCurlyBlock start="{" end="}" contains=ALLBUT,@rubyNotTop fold
|
221
|
+
syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@rubyNotTop fold
|
222
|
+
|
223
|
+
" statements without 'do'
|
224
|
+
syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
225
|
+
syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
226
|
+
syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
227
|
+
|
228
|
+
syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression
|
229
|
+
syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression
|
230
|
+
|
231
|
+
syn match rubyExceptional "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyBlockExpression
|
232
|
+
syn match rubyMethodExceptional "\<\%(\%(\%(;\|^\)\s*\)\@<=rescue\|else\|ensure\)\>[?!]\@!" contained containedin=rubyMethod
|
233
|
+
|
234
|
+
" statements with optional 'do'
|
235
|
+
syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop
|
236
|
+
syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine fold
|
237
|
+
|
238
|
+
if !exists("ruby_minlines")
|
239
|
+
let ruby_minlines = 50
|
240
|
+
endif
|
241
|
+
exec "syn sync minlines=" . ruby_minlines
|
242
|
+
|
243
|
+
else
|
244
|
+
syn match rubyControl "\<def\>[?!]\@!" nextgroup=rubyMethodDeclaration skipwhite skipnl
|
245
|
+
syn match rubyControl "\<class\>[?!]\@!" nextgroup=rubyClassDeclaration skipwhite skipnl
|
246
|
+
syn match rubyControl "\<module\>[?!]\@!" nextgroup=rubyModuleDeclaration skipwhite skipnl
|
247
|
+
syn match rubyControl "\<\%(case\|begin\|do\|for\|if\|unless\|while\|until\|else\|elsif\|ensure\|then\|when\|end\)\>[?!]\@!"
|
248
|
+
syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!"
|
249
|
+
endif
|
250
|
+
|
251
|
+
" Special Methods
|
252
|
+
if !exists("ruby_no_special_methods")
|
253
|
+
syn keyword rubyAccess public protected private module_function
|
254
|
+
" attr is a common variable name
|
255
|
+
syn match rubyAttribute "\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!"
|
256
|
+
syn keyword rubyAttribute attr_accessor attr_reader attr_writer
|
257
|
+
syn match rubyControl "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>[?!]\@!\)"
|
258
|
+
syn keyword rubyEval eval class_eval instance_eval module_eval
|
259
|
+
syn keyword rubyException raise fail catch throw
|
260
|
+
" false positive with 'include?'
|
261
|
+
syn match rubyInclude "\<include\>[?!]\@!"
|
262
|
+
syn keyword rubyInclude autoload extend load require
|
263
|
+
syn keyword rubyKeyword callcc caller lambda proc
|
264
|
+
endif
|
265
|
+
|
266
|
+
" Comments and Documentation
|
267
|
+
syn match rubySharpBang "\%^#!.*" display
|
268
|
+
syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE XXX contained
|
269
|
+
syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell
|
270
|
+
if !exists("ruby_no_comment_fold")
|
271
|
+
syn region rubyMultilineComment start="\%(\%(^\s*#.*\n\)\@<!\%(^\s*#.*\n\)\)\%(\(^\s*#.*\n\)\{1,}\)\@=" end="\%(^\s*#.*\n\)\@<=\%(^\s*#.*\n\)\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend
|
272
|
+
syn region rubyDocumentation start="^=begin\ze\%(\s.*\)\=$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell fold
|
273
|
+
else
|
274
|
+
syn region rubyDocumentation start="^=begin\s*$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell
|
275
|
+
endif
|
276
|
+
|
277
|
+
" Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver
|
278
|
+
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(alias\|and\|begin\|break\|case\|class\|def\|defined\|do\|else\)\>" transparent contains=NONE
|
279
|
+
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(elsif\|end\|ensure\|false\|for\|if\|in\|module\|next\|nil\)\>" transparent contains=NONE
|
280
|
+
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(not\|or\|redo\|rescue\|retry\|return\|self\|super\|then\|true\)\>" transparent contains=NONE
|
281
|
+
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(undef\|unless\|until\|when\|while\|yield\|BEGIN\|END\|__FILE__\|__LINE__\)\>" transparent contains=NONE
|
282
|
+
|
283
|
+
syn match rubyKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)[?!]" transparent contains=NONE
|
284
|
+
syn match rubyKeywordAsMethod "\<\%(if\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE
|
285
|
+
|
286
|
+
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(abort\|at_exit\|attr\|attr_accessor\|attr_reader\)\>" transparent contains=NONE
|
287
|
+
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(attr_writer\|autoload\|callcc\|catch\|caller\)\>" transparent contains=NONE
|
288
|
+
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(eval\|class_eval\|instance_eval\|module_eval\|exit\)\>" transparent contains=NONE
|
289
|
+
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fail\|fork\|include\|lambda\)\>" transparent contains=NONE
|
290
|
+
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(load\|loop\|private\|proc\|protected\)\>" transparent contains=NONE
|
291
|
+
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(public\|require\|raise\|throw\|trap\)\>" transparent contains=NONE
|
292
|
+
|
293
|
+
" __END__ Directive
|
294
|
+
syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold
|
295
|
+
|
296
|
+
hi def link rubyClass rubyDefine
|
297
|
+
hi def link rubyModule rubyDefine
|
298
|
+
hi def link rubyMethodExceptional rubyDefine
|
299
|
+
hi def link rubyDefine Define
|
300
|
+
hi def link rubyFunction Function
|
301
|
+
hi def link rubyConditional Conditional
|
302
|
+
hi def link rubyConditionalModifier rubyConditional
|
303
|
+
hi def link rubyExceptional rubyConditional
|
304
|
+
hi def link rubyRepeat Repeat
|
305
|
+
hi def link rubyRepeatModifier rubyRepeat
|
306
|
+
hi def link rubyOptionalDo rubyRepeat
|
307
|
+
hi def link rubyControl Statement
|
308
|
+
hi def link rubyInclude Include
|
309
|
+
hi def link rubyInteger Number
|
310
|
+
hi def link rubyASCIICode Character
|
311
|
+
hi def link rubyFloat Float
|
312
|
+
hi def link rubyBoolean Boolean
|
313
|
+
hi def link rubyException Exception
|
314
|
+
if !exists("ruby_no_identifiers")
|
315
|
+
hi def link rubyIdentifier Identifier
|
316
|
+
else
|
317
|
+
hi def link rubyIdentifier NONE
|
318
|
+
endif
|
319
|
+
hi def link rubyClassVariable rubyIdentifier
|
320
|
+
hi def link rubyConstant Type
|
321
|
+
hi def link rubyGlobalVariable rubyIdentifier
|
322
|
+
hi def link rubyBlockParameter rubyIdentifier
|
323
|
+
hi def link rubyInstanceVariable rubyIdentifier
|
324
|
+
hi def link rubyPredefinedIdentifier rubyIdentifier
|
325
|
+
hi def link rubyPredefinedConstant rubyPredefinedIdentifier
|
326
|
+
hi def link rubyPredefinedVariable rubyPredefinedIdentifier
|
327
|
+
hi def link rubySymbol Constant
|
328
|
+
hi def link rubyKeyword Keyword
|
329
|
+
hi def link rubyOperator Operator
|
330
|
+
hi def link rubyPseudoOperator rubyOperator
|
331
|
+
hi def link rubyBeginEnd Statement
|
332
|
+
hi def link rubyAccess Statement
|
333
|
+
hi def link rubyAttribute Statement
|
334
|
+
hi def link rubyEval Statement
|
335
|
+
hi def link rubyPseudoVariable Constant
|
336
|
+
|
337
|
+
hi def link rubyComment Comment
|
338
|
+
hi def link rubyData Comment
|
339
|
+
hi def link rubyDataDirective Delimiter
|
340
|
+
hi def link rubyDocumentation Comment
|
341
|
+
hi def link rubyTodo Todo
|
342
|
+
|
343
|
+
hi def link rubyQuoteEscape rubyStringEscape
|
344
|
+
hi def link rubyStringEscape Special
|
345
|
+
hi def link rubyInterpolationDelimiter Delimiter
|
346
|
+
hi def link rubyNoInterpolation rubyString
|
347
|
+
hi def link rubySharpBang PreProc
|
348
|
+
hi def link rubyRegexpDelimiter rubyStringDelimiter
|
349
|
+
hi def link rubySymbolDelimiter rubyStringDelimiter
|
350
|
+
hi def link rubyStringDelimiter Delimiter
|
351
|
+
hi def link rubyString String
|
352
|
+
hi def link rubyRegexpEscape rubyRegexpSpecial
|
353
|
+
hi def link rubyRegexpQuantifier rubyRegexpSpecial
|
354
|
+
hi def link rubyRegexpAnchor rubyRegexpSpecial
|
355
|
+
hi def link rubyRegexpDot rubyRegexpCharClass
|
356
|
+
hi def link rubyRegexpCharClass rubyRegexpSpecial
|
357
|
+
hi def link rubyRegexpSpecial Special
|
358
|
+
hi def link rubyRegexpComment Comment
|
359
|
+
hi def link rubyRegexp rubyString
|
360
|
+
|
361
|
+
hi def link rubyInvalidVariable Error
|
362
|
+
hi def link rubyError Error
|
363
|
+
hi def link rubySpaceError rubyError
|
364
|
+
|
365
|
+
let b:current_syntax = "ruby"
|
366
|
+
|
367
|
+
" vim: nowrap sw=2 sts=2 ts=8 noet:
|