mirror of
https://github.com/amix/vimrc
synced 2025-06-17 10:55:00 +08:00
Updated plugins
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if &syntax !~# '\<eruby\>' || get(b:, 'current_syntax') =~# '\<eruby\>'
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
@ -18,8 +18,6 @@ endif
|
||||
|
||||
if &filetype =~ '^eruby\.'
|
||||
let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+')
|
||||
elseif &filetype =~ '^.*\.eruby\>'
|
||||
let b:eruby_subtype = matchstr(&filetype,'^.\{-\}\ze\.eruby\>')
|
||||
elseif !exists("b:eruby_subtype") && main_syntax == 'eruby'
|
||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
|
||||
@ -53,10 +51,10 @@ if !b:eruby_nest_level
|
||||
let b:eruby_nest_level = 1
|
||||
endif
|
||||
|
||||
if get(b:, 'eruby_subtype', '') !~# '^\%(eruby\)\=$' && &syntax =~# '^eruby\>'
|
||||
if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=? 'eruby'
|
||||
exe "runtime! syntax/".b:eruby_subtype.".vim"
|
||||
unlet! b:current_syntax
|
||||
endif
|
||||
unlet! b:current_syntax
|
||||
syn include @rubyTop syntax/ruby.vim
|
||||
|
||||
syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,erubyComment
|
||||
@ -71,7 +69,7 @@ exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:erub
|
||||
hi def link erubyDelimiter PreProc
|
||||
hi def link erubyComment Comment
|
||||
|
||||
let b:current_syntax = matchstr(&syntax, '^.*\<eruby\>')
|
||||
let b:current_syntax = 'eruby'
|
||||
|
||||
if main_syntax == 'eruby'
|
||||
unlet main_syntax
|
||||
|
@ -144,9 +144,9 @@ syn cluster rubyStringSpecial contains=rubyInterpolation,rubyStringEscape
|
||||
syn cluster rubyStringNotTop contains=@rubyStringSpecial,@rubyNestedBrackets,@rubySingleCharEscape
|
||||
|
||||
" Regular Expression Metacharacters {{{1
|
||||
syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\\\\|\\)" end=")" contained
|
||||
syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\\\\|\\)" end=")" contained transparent contains=@rubyRegexpSpecial
|
||||
syn region rubyRegexpBrackets matchgroup=rubyRegexpCharClass start="\[\^\=" skip="\\\\\|\\\]" end="\]" contained transparent contains=rubyRegexpBrackets,rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass,rubyRegexpIntersection oneline
|
||||
syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\\\\|\\)" end=")" contained
|
||||
syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\%(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\\\\|\\)" end=")" contained transparent contains=@rubyRegexpSpecial
|
||||
syn region rubyRegexpBrackets matchgroup=rubyRegexpCharClass start="\[\^\=" skip="\\\\\|\\\]" end="\]" contained transparent contains=rubyRegexpBrackets,rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass,rubyRegexpIntersection oneline
|
||||
syn match rubyRegexpCharClass "\\[DdHhRSsWw]" contained display
|
||||
syn match rubyRegexpCharClass "\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]" contained
|
||||
syn match rubyRegexpCharClass "\\[pP]{^\=.\{-}}" contained display
|
||||
@ -345,7 +345,7 @@ syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,
|
||||
syn match rubyControl "\%#=1\<\%(break\|in\|next\|redo\|retry\|return\)\>"
|
||||
syn match rubyKeyword "\%#=1\<\%(super\|yield\)\>"
|
||||
syn match rubyBoolean "\%#=1\<\%(true\|false\)\>[?!]\@!"
|
||||
syn match rubyPseudoVariable "\%#=1\<\(self\|nil\)\>[?!]\@!"
|
||||
syn match rubyPseudoVariable "\%#=1\<\%(self\|nil\)\>[?!]\@!"
|
||||
syn match rubyPseudoVariable "\%#=1\<__\%(ENCODING\|dir\|FILE\|LINE\|callee\|method\)__\>"
|
||||
syn match rubyBeginEnd "\%#=1\<\%(BEGIN\|END\)\>"
|
||||
|
||||
@ -363,6 +363,9 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
|
||||
SynFold 'class' syn region rubyClassBlock start="\<class\>" matchgroup=rubyClass skip="\<end:" end="\<end\>" contains=ALLBUT,@rubyNotTop
|
||||
SynFold 'module' syn region rubyModuleBlock start="\<module\>" matchgroup=rubyModule skip="\<end:" end="\<end\>" contains=ALLBUT,@rubyNotTop
|
||||
|
||||
" endless def
|
||||
syn match rubyDefine "\<def\s\+\ze[^[:space:];#(]\+\%(\s\+\|\s*(.*)\s*\)=" nextgroup=rubyMethodDeclaration skipwhite
|
||||
|
||||
" modifiers
|
||||
syn match rubyLineContinuation "\\$" nextgroup=@rubyModifier skipwhite skipnl
|
||||
syn match rubyConditionalModifier "\<\%(if\|unless\)\>"
|
||||
@ -414,7 +417,7 @@ if !exists("ruby_no_special_methods")
|
||||
syn match rubyAccess "\%#=1\<\%(public\|private\)_class_method\>"
|
||||
syn match rubyAccess "\%#=1\<\%(public\|private\)_constant\>"
|
||||
syn match rubyAccess "\%#=1\<module_function\>"
|
||||
syn match rubyAttribute "\%#=1\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!" " attr is a common variable name
|
||||
syn match rubyAttribute "\%#=1\%(\%(^\|;\)\s*\)\@<=attr\>\%(\s*[.=]\)\@!" " attr is a common variable name
|
||||
syn match rubyAttribute "\%#=1\<attr_\%(accessor\|reader\|writer\)\>"
|
||||
syn match rubyControl "\%#=1\<\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>"
|
||||
syn match rubyEval "\%#=1\<eval\>"
|
||||
|
Reference in New Issue
Block a user