blob: 806afe79117a9401fa5b9260ae60a526b444bccc (
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
90
91
92
93
|
# http://jinja.pocoo.org/
# jinja2 is a full featured template engine for Python. It has full
# unicode support, an optional integrated sandboxed execution
# environment, widely used and BSD licensed.
# possible extends:
#extends html
snippet block "block" b
{% block ${1:name} %}
$2
{% endblock %}
endsnippet
snippet {{ "variable" b
{{ $1 }}
endsnippet
snippet {# "comment" b
{# $1 #}
endsnippet
snippet # "comment" b
{# $1 #}
endsnippet
snippet extends "extends" b
{% extends "${1:template}" %}
endsnippet
snippet include "include" b
{% include "${1:template}" %}
endsnippet
snippet import "import" b
{% import "${1:template}" %}
endsnippet
snippet from "from/import/as" b
{% from "${1:template}" import ${2:name}${3: as ${4:$2}} %}
endsnippet
snippet for "for" b
{% for ${1:item} in ${2:sequence} %}
$3
{% endfor %}
endsnippet
snippet fore "for/else" b
{% for ${1:item} in ${2:sequence} %}
$3
{% else %}
$4
{% endfor %}
endsnippet
snippet if "if" b
{% if ${1:expr} %}
$2
{% endif %}
endsnippet
snippet ife "if/else" b
{% if ${1:expr} %}
$2
{% else %}
$3
{% endif %}
endsnippet
snippet ifee "if/elif/else" b
{% if ${1:expr} %}
$2
{% elif %}
$3
{% else %}
$4
{% endif %}
endsnippet
|