annotate runtime/syntax/django.vim @ 20135:571f632f0aa2

Added tag v8.2.0622 for changeset 352701a626ed31b361ee0c706c8b107411e79dca
author Bram Moolenaar <Bram@vim.org>
date Thu, 23 Apr 2020 16:15:05 +0200
parents 46763b01cd9a
children c725b8e17f1f
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>
6091
7090d7f160f7 Update runtime files. Add vroom file support.
Bram Moolenaar <bram@vim.org>
parents: 3465
diff changeset
4 " Last Change: 2014 Jul 13
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
5
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6091
diff changeset
6 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6091
diff changeset
7 if exists("b:current_syntax")
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
8 finish
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
9 endif
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
10
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
11 syntax case match
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
12
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
13 " Mark illegal characters
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
14 syn match djangoError "%}\|}}\|#}"
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
15
798
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
2200
99ba9a30755a Various smaller changes. Updated proto files. Updated dependencies.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
18 syn keyword djangoStatement contained autoescape csrf_token empty
99ba9a30755a Various smaller changes. Updated proto files. Updated dependencies.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
19 " FIXME ==, !=, <, >, <=, and >= should be djangoStatements:
99ba9a30755a Various smaller changes. Updated proto files. Updated dependencies.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
20 " syn keyword djangoStatement contained == != < > <= >=
3465
161d01cbb165 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2200
diff changeset
21 syn keyword djangoStatement contained and as block endblock by cycle debug else elif
2200
99ba9a30755a Various smaller changes. Updated proto files. Updated dependencies.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
22 syn keyword djangoStatement contained extends filter endfilter firstof for
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
23 syn keyword djangoStatement contained endfor if endif ifchanged endifchanged
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
24 syn keyword djangoStatement contained ifequal endifequal ifnotequal
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
25 syn keyword djangoStatement contained endifnotequal in include load not now or
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
26 syn keyword djangoStatement contained parsed regroup reversed spaceless
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
27 syn keyword djangoStatement contained endspaceless ssi templatetag openblock
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
28 syn keyword djangoStatement contained closeblock openvariable closevariable
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
29 syn keyword djangoStatement contained openbrace closebrace opencomment
1215
1d08aac0aea9 updated for version 7.1b
vimboss
parents: 1123
diff changeset
30 syn keyword djangoStatement contained closecomment widthratio url with endwith
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
31 syn keyword djangoStatement contained get_current_language trans noop blocktrans
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
32 syn keyword djangoStatement contained endblocktrans get_available_languages
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
33 syn keyword djangoStatement contained get_current_language_bidi plural
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
34
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
35 " Django templete built-in filters
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
36 syn keyword djangoFilter contained add addslashes capfirst center cut date
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
37 syn keyword djangoFilter contained default default_if_none dictsort
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1215
diff changeset
38 syn keyword djangoFilter contained dictsortreversed divisibleby escape escapejs
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
39 syn keyword djangoFilter contained filesizeformat first fix_ampersands
2200
99ba9a30755a Various smaller changes. Updated proto files. Updated dependencies.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
40 syn keyword djangoFilter contained floatformat get_digit join last length length_is
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
41 syn keyword djangoFilter contained linebreaks linebreaksbr linenumbers ljust
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
42 syn keyword djangoFilter contained lower make_list phone2numeric pluralize
2200
99ba9a30755a Various smaller changes. Updated proto files. Updated dependencies.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
43 syn keyword djangoFilter contained pprint random removetags rjust slice slugify
99ba9a30755a Various smaller changes. Updated proto files. Updated dependencies.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
44 syn keyword djangoFilter contained safe safeseq stringformat striptags
3465
161d01cbb165 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2200
diff changeset
45 syn keyword djangoFilter contained time timesince timeuntil title truncatechars
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1215
diff changeset
46 syn keyword djangoFilter contained truncatewords truncatewords_html unordered_list upper urlencode
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
47 syn keyword djangoFilter contained urlize urlizetrunc wordcount wordwrap yesno
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
48
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
49 " Keywords to highlight within comments
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
50 syn keyword djangoTodo contained TODO FIXME XXX
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
51
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
52 " Django template constants (always surrounded by double quotes)
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
53 syn region djangoArgument contained start=/"/ skip=/\\"/ end=/"/
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
54
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
55 " Mark illegal characters within tag and variables blocks
2200
99ba9a30755a Various smaller changes. Updated proto files. Updated dependencies.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
56 syn match djangoTagError contained "#}\|{{\|[^%]}}\|[&#]"
1215
1d08aac0aea9 updated for version 7.1b
vimboss
parents: 1123
diff changeset
57 syn match djangoVarError contained "#}\|{%\|%}\|[<>!&#%]"
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
58
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
59 " Django template tag and variable blocks
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
60 syn region djangoTagBlock start="{%" end="%}" contains=djangoStatement,djangoFilter,djangoArgument,djangoTagError display
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
61 syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgument,djangoVarError display
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
62
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
63 " Django template 'comment' tag and comment block
6091
7090d7f160f7 Update runtime files. Add vroom file support.
Bram Moolenaar <bram@vim.org>
parents: 3465
diff changeset
64 syn region djangoComment start="{%\s*comment\(\s\+.\{-}\)\?%}" end="{%\s*endcomment\s*%}" contains=djangoTodo
1123
c4cd8ad60bee updated for version 7.1a
vimboss
parents: 798
diff changeset
65 syn region djangoComBlock start="{#" end="#}" contains=djangoTodo
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
66
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
67 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6091
diff changeset
68 " Only when an item doesn't have highlighting yet
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
69
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
70 hi def link djangoTagBlock PreProc
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
71 hi def link djangoVarBlock PreProc
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
72 hi def link djangoStatement Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
73 hi def link djangoFilter Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
74 hi def link djangoArgument Constant
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
75 hi def link djangoTagError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
76 hi def link djangoVarError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
77 hi def link djangoError Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
78 hi def link djangoComment Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
79 hi def link djangoComBlock Comment
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
80 hi def link djangoTodo Todo
798
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
81
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
82
95dac6af3b3a updated for version 7.0232
vimboss
parents:
diff changeset
83 let b:current_syntax = "django"