Source

slimv-newlisp / syntax / newlisp / slimv-syntax-newlisp.vim

" slimv-syntax-scheme.vim:
"               Scheme syntax plugin for Slimv
" Version:      0.9.6
" Last Change:  24 Mar 2012
" Maintainer:   Tamas Kovacs <kovisoft at gmail dot com>
" License:      This file is placed in the public domain.
"               No warranty, express or implied.
"               *** ***   Use At-Your-Own-Risk!   *** ***
"
" =====================================================================
"
"  Load Once:
if exists("b:current_syntax") || exists("g:slimv_disable_newlisp")
  finish
endif
runtime syntax/**/z-inner-newlisp.vim

" Add lisp_rainbow handling

syn region  newlispMultilineComment  start=/#|/ end=/|#/ contains=newlispMultilineComment
syn keyword newlispExtSyntax     ->environment ->namestring
syn match   newlispExtSyntax     "#![-a-z!$%&*/:<=>?^_~0-9+.@#%]\+"
syn match   newlispAtomMark      "'"
syn match   newlispAtom          "'[^ \t()]\+" contains=newlispAtomMark
syn cluster newlispListCluster   contains=newlispFunction,newlispString,newlispNumber,newlispBoolean,newlispComment,newlispQuote,newlispError,newlispExtSyntax,newlispAtom

hi def link newlispAtomMark      Delimiter
hi def link newlispAtom          Identifier

if exists("g:lisp_rainbow") && g:lisp_rainbow != 0
    syn region newlispParen0           matchgroup=hlLevel0 start="`\=(" end=")" skip="|.\{-}|" contains=@newlispListCluster,newlispParen1
    syn region newlispParen1 contained matchgroup=hlLevel1 start="`\=(" end=")" skip="|.\{-}|" contains=@newlispListCluster,newlispParen2
    syn region newlispParen2 contained matchgroup=hlLevel2 start="`\=(" end=")" skip="|.\{-}|" contains=@newlispListCluster,newlispParen3
    syn region newlispParen3 contained matchgroup=hlLevel3 start="`\=(" end=")" skip="|.\{-}|" contains=@newlispListCluster,newlispParen4
    syn region newlispParen4 contained matchgroup=hlLevel4 start="`\=(" end=")" skip="|.\{-}|" contains=@newlispListCluster,newlispParen5
    syn region newlispParen5 contained matchgroup=hlLevel5 start="`\=(" end=")" skip="|.\{-}|" contains=@newlispListCluster,newlispParen6
    syn region newlispParen6 contained matchgroup=hlLevel6 start="`\=(" end=")" skip="|.\{-}|" contains=@newlispListCluster,newlispParen7
    syn region newlispParen7 contained matchgroup=hlLevel7 start="`\=(" end=")" skip="|.\{-}|" contains=@newlispListCluster,newlispParen8
    syn region newlispParen8 contained matchgroup=hlLevel8 start="`\=(" end=")" skip="|.\{-}|" contains=@newlispListCluster,newlispParen9
    syn region newlispParen9 contained matchgroup=hlLevel9 start="`\=(" end=")" skip="|.\{-}|" contains=@newlispListCluster,newlispParen0

    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