annotate runtime/syntax/django.vim @ 834:5117153003bd v7.0e

updated for version 7.0e
author vimboss
date Sun, 16 Apr 2006 18:30:08 +0000
parents 95dac6af3b3a
children c4cd8ad60bee
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
1 " Vim syntax file
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
2 " Language: Django template
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
3 " Maintainer: Dave Hodder <dmh@dmh.org.uk>
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
4 " Last Change: 2006 Mar 23
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
5
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
6 " For version 5.x: Clear all syntax items
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
7 " For version 6.x: Quit when a syntax file was already loaded
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
8 if version < 600
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
9 syntax clear
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
10 elseif exists("b:current_syntax")
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
11 finish
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
12 endif
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
13
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
14 syntax case match
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
15
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
16 " Django template built-in tags and parameters
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
17 " 'comment' doesn't appear here because it gets special treatment
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
18 syn keyword djangoStatement contained as block endblock by cycle debug else
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
19 syn keyword djangoStatement contained extends filter endfilter firstof for
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
20 syn keyword djangoStatement contained endfor if endif ifchanged endifchanged
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
21 syn keyword djangoStatement contained ifequal endifequal ifnotequal
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
22 syn keyword djangoStatement contained endifnotequal in include load not now or
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
23 syn keyword djangoStatement contained parsed regroup reversed spaceless
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
24 syn keyword djangoStatement contained endspaceless ssi templatetag openblock
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
25 syn keyword djangoStatement contained closeblock openvariable closevariable
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
26 syn keyword djangoStatement contained widthratio with
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
27
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
28 " Django templete built-in filters
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
29 syn keyword djangoFilter contained add addslashes capfirst center cut date
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
30 syn keyword djangoFilter contained default default_if_none dictsort
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
31 syn keyword djangoFilter contained dictsortreversed divisibleby escape
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
32 syn keyword djangoFilter contained filesizeformat first fix_ampersands
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
33 syn keyword djangoFilter contained floatformat get_digit join length length_is
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
34 syn keyword djangoFilter contained linebreaks linebreaksbr linenumbers ljust
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
35 syn keyword djangoFilter contained lower make_list phone2numeric pluralize
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
36 syn keyword djangoFilter contained pprint random removetags rjust slice slugify
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
37 syn keyword djangoFilter contained stringformat striptags time timesince title
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
38 syn keyword djangoFilter contained truncatewords unordered_list upper urlencode
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
39 syn keyword djangoFilter contained urlize urlizetrunc wordcount wordwrap yesno
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
40
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
41 " Django template constants (always surrounded by double quotes)
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
42 syn region djangoArgument contained start=/"/ skip=/\\"/ end=/"/
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
43
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
44 " Django template tag and variable blocks
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
45 syn region djangoTagBlock start="{%" end="%}" contains=djangoStatement,djangoFilter,djangoArgument display
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
46 syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgument display
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
47
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
48 " Django template 'comment' tag
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
49 syn region djangoComment start="{%\s*comment\s*%}" end="{%\s*endcomment\s*%}"
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
50
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
51 " Define the default highlighting.
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
52 " For version 5.7 and earlier: only when not done already
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
53 " For version 5.8 and later: only when an item doesn't have highlighting yet
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
54 if version >= 508 || !exists("did_django_syn_inits")
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
55 if version < 508
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
56 let did_django_syn_inits = 1
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
57 command -nargs=+ HiLink hi link <args>
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
58 else
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
59 command -nargs=+ HiLink hi def link <args>
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
60 endif
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
61
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
62 HiLink djangoTagBlock PreProc
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
63 HiLink djangoVarBlock PreProc
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
64 HiLink djangoStatement Statement
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
65 HiLink djangoFilter Identifier
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
66 HiLink djangoArgument Constant
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
67 HiLink djangoComment Comment
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
68
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
69 delcommand HiLink
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
70 endif
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
71
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
72 let b:current_syntax = "django"