vim-snippets/snippets/twig.snippets

35 lines
816 B
Plaintext
Raw Normal View History

2016-05-27 09:18:12 -04:00
snippet bl "{% block xyz %} .. {% endblock xyz %}"
{% block ${1} %}
${2}
{% endblock $1 %}
2016-05-27 09:18:12 -04:00
snippet js "{% javascripts 'xyz' %} .. {% endjavascripts %}"
{% javascripts '${1}' %}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
2016-05-27 09:18:12 -04:00
snippet css "{% stylesheets 'xyz' %} .. {% endstylesheets %}"
{% stylesheets '${1}' %}
<link rel="stylesheet" href="{{ asset_url }}">
{% endstylesheets %}
2016-05-27 09:18:12 -04:00
snippet if "{% if %} .. {% endif %}"
{% if ${1} %}
${2}
{% endif %}
2016-05-27 09:18:12 -04:00
snippet ife "{% if %} .. {% else %} .. {% endif %}"
{% if ${1} %}
${2}
{% else %}
${0}
{% endif %}
2016-05-27 09:18:12 -04:00
snippet el "{% else %}"
{% else %}
${0}
2016-05-27 09:18:12 -04:00
snippet eif "{% elseif %}"
{% elseif ${1} %}
${0}
2016-05-27 09:18:12 -04:00
snippet for "{% for x in y %} .. {% endfor %}"
{% for ${1} in ${2} %}
${3}
{% endfor %}
2016-05-27 09:18:12 -04:00
snippet ext "{% extends xyz %}"
{% extends ${1} %}