diff options
Diffstat (limited to 'runtime/syntax/falcon.vim')
-rw-r--r-- | runtime/syntax/falcon.vim | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/runtime/syntax/falcon.vim b/runtime/syntax/falcon.vim index 0ff500ccc..1f6fefa9f 100644 --- a/runtime/syntax/falcon.vim +++ b/runtime/syntax/falcon.vim @@ -3,8 +3,8 @@ " Maintainer: Steven Oliver <oliver.steven@gmail.com> " Website: http://github.com/steveno/vim-files/blob/master/syntax/falcon.vim " Credits: Thanks the ruby.vim authors, I borrowed a lot! +" Thanks to the lisp authors for the rainbow code! " ------------------------------------------------------------------------------- -" GetLatestVimScripts: 2745 1 :AutoInstall: falcon.vim " When wanted, highlight the trailing whitespace. if exists("c_space_errors") @@ -56,6 +56,7 @@ syn keyword falconBool true false " Constants syn keyword falconConst PI E nil +syn match falconConstant "\%(\%([.@$]\@<!\.\)\@<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=\%(\s*(\)\@!" " Comments syn match falconCommentSkip contained "^\s*\*\($\|\s\+\)" @@ -116,6 +117,47 @@ syn region falconString start=+\%(\%(class\s*\|\%([]}).]\|::\)\)\_s*\|\w\)\@<!<< syn region falconString start=+\%(\%(class\s*\|\%([]}).]\|::\)\)\_s*\|\w\)\@<!<<-'\z([^']*\)'\ze+hs=s+3 matchgroup=falconStringDelimiter end=+^\s*\zs\z1$+ fold keepend syn region falconString start=+\%(\%(class\s*\|\%([]}).]\|::\)\)\_s*\|\w\)\@<!<<-`\z([^`]*\)`\ze+hs=s+3 matchgroup=falconStringDelimiter end=+^\s*\zs\z1$+ contains=falconStringEscape fold keepend +" Falcon rainbox to highlight parens in varying colors +if exists("g:falcon_rainbow") && g:falcon_rainbow != 0 + syn region falconParen0 matchgroup=hlLevel0 start="`\=(" end=")" skip="|.\{-}|" contains=@falconListCluster,falconParen1 + syn region falconParen1 contained matchgroup=hlLevel1 start="`\=(" end=")" skip="|.\{-}|" contains=@falconListCluster,falconParen2 + syn region falconParen2 contained matchgroup=hlLevel2 start="`\=(" end=")" skip="|.\{-}|" contains=@falconListCluster,falconParen3 + syn region falconParen3 contained matchgroup=hlLevel3 start="`\=(" end=")" skip="|.\{-}|" contains=@falconListCluster,falconParen4 + syn region falconParen4 contained matchgroup=hlLevel4 start="`\=(" end=")" skip="|.\{-}|" contains=@falconListCluster,falconParen5 + syn region falconParen5 contained matchgroup=hlLevel5 start="`\=(" end=")" skip="|.\{-}|" contains=@falconListCluster,falconParen6 + syn region falconParen6 contained matchgroup=hlLevel6 start="`\=(" end=")" skip="|.\{-}|" contains=@falconListCluster,falconParen7 + syn region falconParen7 contained matchgroup=hlLevel7 start="`\=(" end=")" skip="|.\{-}|" contains=@falconListCluster,falconParen8 + syn region falconParen8 contained matchgroup=hlLevel8 start="`\=(" end=")" skip="|.\{-}|" contains=@falconListCluster,falconParen9 + syn region falconParen9 contained matchgroup=hlLevel9 start="`\=(" end=")" skip="|.\{-}|" contains=@falconListCluster,falconParen0 +endif + +" Setup the colors for the rainbox +if exists("g:falcon_rainbow") && g:falcon_rainbow != 0 + if &bg == "dark" + hi def hlLevel0 ctermfg=red guifg=red1 + hi def hlLevel1 ctermfg=yellow guifg=orange1 + hi def hlLevel2 ctermfg=green guifg=yellow1 + hi def hlLevel3 ctermfg=cyan guifg=greenyellow + hi def hlLevel4 ctermfg=magenta guifg=green1 + hi def hlLevel5 ctermfg=red guifg=springgreen1 + hi def hlLevel6 ctermfg=yellow guifg=cyan1 + hi def hlLevel7 ctermfg=green guifg=slateblue1 + hi def hlLevel8 ctermfg=cyan guifg=magenta1 + hi def hlLevel9 ctermfg=magenta guifg=purple1 + else + hi def hlLevel0 ctermfg=red guifg=red3 + hi def hlLevel1 ctermfg=darkyellow guifg=orangered3 + hi def hlLevel2 ctermfg=darkgreen guifg=orange2 + hi def hlLevel3 ctermfg=blue guifg=yellow3 + hi def hlLevel4 ctermfg=darkmagenta guifg=olivedrab4 + hi def hlLevel5 ctermfg=red guifg=green4 + hi def hlLevel6 ctermfg=darkyellow guifg=paleturquoise3 + hi def hlLevel7 ctermfg=darkgreen guifg=deepskyblue4 + hi def hlLevel8 ctermfg=blue guifg=darkslateblue + hi def hlLevel9 ctermfg=darkmagenta guifg=darkviolet + endif +endif + " Syntax Synchronizing syn sync minlines=10 maxlines=100 @@ -132,6 +174,7 @@ if !exists("did_falcon_syn_inits") HiLink falconComment Comment HiLink falconCommentL Comment HiLink falconConst Constant + HiLink falconConstants Constant HiLink falconOperator Operator HiLink falconSymbol Normal HiLink falconSpaceError Error @@ -153,3 +196,4 @@ endif let b:current_syntax = "falcon" " vim: set sw=4 sts=4 et tw=80 : + |