-
Notifications
You must be signed in to change notification settings - Fork 230
/
Copy pathtwig.snip
159 lines (135 loc) · 3.04 KB
/
twig.snip
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
snippet autoescape
abbr {% autoescape ... %} ... {% endautoescape %}
options head
{% autoescape ${1:#:strategy} %}
${0:TARGET}
{% autoescape %}
snippet block
abbr {% block ... %} ... {% endblock %}
alias bl
options head
{% block ${1:#:name} %}
${0:TARGET}
{% endblock %}
snippet dump
abbr <pre> {{ dump(...) }} </pre>
options head
<pre>
{{ dump(${0:TARGET}) }}
</pre>
snippet embed
abbr {% embed ... %} ... {% endembed %}
options head
{% embed '${1:template}' %}
{% block ${2} %}
${0:TARGET}
{% endblock %}
{% endembed %}
snippet extends
abbr {% extends ... %}
alias ext
options head
{% extends '${1:#:template}' %}
snippet filter
abbr {% filter ... %} ... {% endfilter %}
options head
{% filter ${1} %}
${0:TARGET}
{% endfilter %}
snippet flush
abbr {% flush %}
options head
{% flush %}
snippet for
abbr {% for ... in ... %} ... {% endfor %}
options head
{% for ${1:#:value} in ${2:#:list} %}
${0:TARGET}
{% endfor %}
snippet from
abbr {% from '...' import ... %}
options head
{% from '${1:#:module}' import ${2:#:macro} %}
snippet if
abbr {% if ... %} ... {% endif %}
options head
{% if ${1} %}
${0:TARGET}
{% endif %}
snippet elseif
abbr {% elseif ... %} ...
alias elif
options head
{% elseif ${1} %}
${0:TARGET}
snippet else
abbr {% else %} ...
options head
{% else %}
${0:TARGET}
snippet import
abbr {% import '...' as ... %}
options head
{% import '${1:#:module}' as ${2:#:namespace} %}
snippet include
abbr {% include '...' %}
options head
{% include '${1:#:template}' %}
snippet includewith
abbr {% include '...' %}
options head
{% include '${1:#:template}' with {${2:#:'key'}: ${2:#:'value'}} %}
snippet macro
abbr {% macro ...(...) %} ... {% endmacro %}
options head
{% macro ${1:#:name}(${2:#:args}) %}
${0:TARGET}
{% endmacro %}
snippet sandbox
abbr {% sandbox %} ... {% endsandbox %}
options head
{% sandbox %}
${0:TARGET}
{% endsandbox %}
snippet set
abbr {% set ... = ... %}
options head
{% set ${1:#:var} = ${2:#:value} %}
snippet setblock
abbr {% set ... %} ... {% endset %}
options head
{% set ${1:#:var} %}
${0:TARGET}
{% endset %}
snippet spaceless
abbr {% spaceless %} ... {% endspaceless %}
options head
{% spaceless %}
${0:TARGET}
{% endspaceless %}
snippet use
abbr {% use '...' %}
options head
{% use '${1:#:template}' %}
snippet verbatim
abbr {% verbatim %} ... {% endverbatim %}
options head
{% verbatim %}
${0:TARGET}
{% endverbatim %}
snippet comment
abbr {# ... #}
alias #
options head
{# ${1:comment} #}
snippet tag
abbr {% ... %}
alias %
options head
{% ${1:#:tag} %}
snippet tagblock
abbr {% ... %} ... {% end... %}
options head
{% ${1:#:tag} ${2:#:name} %}
${0:TARGET}
{% end$1 %}