summaryrefslogtreecommitdiff
path: root/vim/bundle/slimv/syntax/scheme/slimv-syntax-scheme.vim
blob: d58a467cd450bd88a5e3292925799494d29ea012 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
" slimv-syntax-scheme.vim:
"               Scheme syntax plugin for Slimv
" Version:      0.9.9
" Last Change:  10 Nov 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_scheme")
  finish
endif

runtime syntax/**/scheme.vim

" Add lisp_rainbow handling

syn region  schemeMultilineComment  start=/#|/ end=/|#/ contains=schemeMultilineComment
syn keyword schemeExtSyntax     ->environment ->namestring
syn match   schemeExtSyntax     "#![-a-z!$%&*/:<=>?^_~0-9+.@#%]\+"
syn match   schemeAtomMark      "'"
syn match   schemeAtom          "'[^ \t()\[\]{}]\+" contains=schemeAtomMark
syn cluster schemeListCluster   contains=schemeSyntax,schemeFunc,schemeString,schemeCharacter,schemeNumber,schemeBoolean,schemeConstant,schemeComment,schemeMultilineComment,schemeQuoted,schemeUnquote,schemeStrucRestricted,schemeOther,schemeError,schemeExtSyntax,schemeExtFunc,schemeAtom,schemeDelimiter

hi def link schemeAtomMark      Delimiter
hi def link schemeAtom          Identifier

if exists("g:lisp_rainbow") && g:lisp_rainbow != 0
    syn region schemeParen0           matchgroup=hlLevel0 start="`\=(" end=")" skip="|.\{-}|" contains=@schemeListCluster,schemeParen1
    syn region schemeParen1 contained matchgroup=hlLevel1 start="`\=(" end=")" skip="|.\{-}|" contains=@schemeListCluster,schemeParen2
    syn region schemeParen2 contained matchgroup=hlLevel2 start="`\=(" end=")" skip="|.\{-}|" contains=@schemeListCluster,schemeParen3
    syn region schemeParen3 contained matchgroup=hlLevel3 start="`\=(" end=")" skip="|.\{-}|" contains=@schemeListCluster,schemeParen4
    syn region schemeParen4 contained matchgroup=hlLevel4 start="`\=(" end=")" skip="|.\{-}|" contains=@schemeListCluster,schemeParen5
    syn region schemeParen5 contained matchgroup=hlLevel5 start="`\=(" end=")" skip="|.\{-}|" contains=@schemeListCluster,schemeParen6
    syn region schemeParen6 contained matchgroup=hlLevel6 start="`\=(" end=")" skip="|.\{-}|" contains=@schemeListCluster,schemeParen7
    syn region schemeParen7 contained matchgroup=hlLevel7 start="`\=(" end=")" skip="|.\{-}|" contains=@schemeListCluster,schemeParen8
    syn region schemeParen8 contained matchgroup=hlLevel8 start="`\=(" end=")" skip="|.\{-}|" contains=@schemeListCluster,schemeParen9
    syn region schemeParen9 contained matchgroup=hlLevel9 start="`\=(" end=")" skip="|.\{-}|" contains=@schemeListCluster,schemeParen0

    syn region schemeParen0           matchgroup=hlLevel0 start="`\=\[" end="\]" skip="|.\{-}|" contains=@schemeListCluster,schemeParen1
    syn region schemeParen1 contained matchgroup=hlLevel1 start="`\=\[" end="\]" skip="|.\{-}|" contains=@schemeListCluster,schemeParen2
    syn region schemeParen2 contained matchgroup=hlLevel2 start="`\=\[" end="\]" skip="|.\{-}|" contains=@schemeListCluster,schemeParen3
    syn region schemeParen3 contained matchgroup=hlLevel3 start="`\=\[" end="\]" skip="|.\{-}|" contains=@schemeListCluster,schemeParen4
    syn region schemeParen4 contained matchgroup=hlLevel4 start="`\=\[" end="\]" skip="|.\{-}|" contains=@schemeListCluster,schemeParen5
    syn region schemeParen5 contained matchgroup=hlLevel5 start="`\=\[" end="\]" skip="|.\{-}|" contains=@schemeListCluster,schemeParen6
    syn region schemeParen6 contained matchgroup=hlLevel6 start="`\=\[" end="\]" skip="|.\{-}|" contains=@schemeListCluster,schemeParen7
    syn region schemeParen7 contained matchgroup=hlLevel7 start="`\=\[" end="\]" skip="|.\{-}|" contains=@schemeListCluster,schemeParen8
    syn region schemeParen8 contained matchgroup=hlLevel8 start="`\=\[" end="\]" skip="|.\{-}|" contains=@schemeListCluster,schemeParen9
    syn region schemeParen9 contained matchgroup=hlLevel9 start="`\=\[" end="\]" skip="|.\{-}|" contains=@schemeListCluster,schemeParen0

    syn region schemeParen0           matchgroup=hlLevel0 start="`\={" end="}" skip="|.\{-}|" contains=@schemeListCluster,schemeParen1
    syn region schemeParen1 contained matchgroup=hlLevel1 start="`\={" end="}" skip="|.\{-}|" contains=@schemeListCluster,schemeParen2
    syn region schemeParen2 contained matchgroup=hlLevel2 start="`\={" end="}" skip="|.\{-}|" contains=@schemeListCluster,schemeParen3
    syn region schemeParen3 contained matchgroup=hlLevel3 start="`\={" end="}" skip="|.\{-}|" contains=@schemeListCluster,schemeParen4
    syn region schemeParen4 contained matchgroup=hlLevel4 start="`\={" end="}" skip="|.\{-}|" contains=@schemeListCluster,schemeParen5
    syn region schemeParen5 contained matchgroup=hlLevel5 start="`\={" end="}" skip="|.\{-}|" contains=@schemeListCluster,schemeParen6
    syn region schemeParen6 contained matchgroup=hlLevel6 start="`\={" end="}" skip="|.\{-}|" contains=@schemeListCluster,schemeParen7
    syn region schemeParen7 contained matchgroup=hlLevel7 start="`\={" end="}" skip="|.\{-}|" contains=@schemeListCluster,schemeParen8
    syn region schemeParen8 contained matchgroup=hlLevel8 start="`\={" end="}" skip="|.\{-}|" contains=@schemeListCluster,schemeParen9
    syn region schemeParen9 contained matchgroup=hlLevel9 start="`\={" end="}" skip="|.\{-}|" contains=@schemeListCluster,schemeParen0

    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