-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjquerytmpl.vim
More file actions
38 lines (29 loc) · 1.04 KB
/
jquerytmpl.vim
File metadata and controls
38 lines (29 loc) · 1.04 KB
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
" Vim syntax file
" Language: jQuery Templates
" Maintainer: David Zhou <dz@disqus.com>
" Last Change: Dec 2010
if exists("b:current_syntax")
finish
endif
"keywords
syn keyword jTmplCommands each else if wrap html containedin=jTmplCommandRegion
"{{ }} region
syn region jTmplCommandRegion start=+{{+ keepend end=+}}+ contains=jTmplCommands
"${var} variable
syn match jTmplVariable '\${[^}]*}' containedin=javaScriptStringS,javaScriptStringD,htmlString
syn match jTmplVariableShortcut '{{=[^}]*}}' containedin=javaScriptStringS,javaScriptStringD,htmlString
syn cluster jTmplAll contains=jTmplVariable,jTmplVariableShortcut
"include django and html syntaxes
runtime! syntax/html.vim
if exists("g:jquerytmpl_django")
runtime! syntax/django.vim
endif
unlet b:current_syntax
let b:current_syntax = "jquerytmpl"
"hilighting
command! -nargs=+ JTmplHiLink hi def link <args>
JTmplHiLink jTmplVariable Identifier
JTmplHiLink jTmplVariableShortcut Identifier
JTmplHiLink jTmplCommands Statement
JTmplHiLink jTmplCommandRegion Identifier
delcommand JTmplHiLink