Merge branch 'vim-with-runtime' into feat/quickfix-title
[vim_extended.git] / runtime / syntax / cheetah.vim
blob7eb17567cff800fd23cf3ba93878eb32f4fddbc7
1 " Vim syntax file
2 " Language:     Cheetah template engine
3 " Maintainer:   Max Ischenko <mfi@ukr.net>
4 " Last Change: 2003-05-11
6 " Missing features:
7 "  match invalid syntax, like bad variable ref. or unmatched closing tag
8 "  PSP-style tags: <% .. %> (obsoleted feature)
9 "  doc-strings and header comments (rarely used feature)
11 " For version 5.x: Clear all syntax items
12 " For version 6.x: Quit when a syntax file was already loaded
13 if version < 600
14         syntax clear
15 elseif exists("b:current_syntax")
16         finish
17 endif
19 syntax case match
21 syn keyword cheetahKeyword contained if else unless elif for in not
22 syn keyword cheetahKeyword contained while repeat break continue pass end
23 syn keyword cheetahKeyword contained set del attr def global include raw echo
24 syn keyword cheetahKeyword contained import from extends implements
25 syn keyword cheetahKeyword contained assert raise try catch finally
26 syn keyword cheetahKeyword contained errorCatcher breakpoint silent cache filter
27 syn match   cheetahKeyword contained "\<compiler-settings\>"
29 " Matches cached placeholders
30 syn match   cheetahPlaceHolder "$\(\*[0-9.]\+[wdhms]\?\*\|\*\)\?\h\w*\(\.\h\w*\)*" display
31 syn match   cheetahPlaceHolder "$\(\*[0-9.]\+[wdhms]\?\*\|\*\)\?{\h\w*\(\.\h\w*\)*}" display
32 syn match   cheetahDirective "^\s*#[^#].*$"  contains=cheetahPlaceHolder,cheetahKeyword,cheetahComment display
34 syn match   cheetahContinuation "\\$"
35 syn match   cheetahComment "##.*$" display
36 syn region  cheetahMultiLineComment start="#\*" end="\*#"
38 " Define the default highlighting.
39 " For version 5.7 and earlier: only when not done already
40 " For version 5.8 and later: only when an item doesn't have highlighting yet
41 if version >= 508 || !exists("did_cheetah_syn_inits")
42         if version < 508
43                 let did_cheetah_syn_inits = 1
44                 command -nargs=+ HiLink hi link <args>
45         else
46                 command -nargs=+ HiLink hi def link <args>
47         endif
49         HiLink cheetahPlaceHolder Identifier
50         HiLink cheetahDirective PreCondit
51         HiLink cheetahKeyword Define
52         HiLink cheetahContinuation Special
53         HiLink cheetahComment Comment
54         HiLink cheetahMultiLineComment Comment
56         delcommand HiLink
57 endif
59 let b:current_syntax = "cheetah"