Correctly indented snipMate template for Twig

This commit is contained in:
Mathew Attlee 2016-05-06 12:29:42 +01:00
parent c3f1a708be
commit b2dda36fc7

View File

@ -1,43 +1,43 @@
# twig block # twig block
snippet bl snippet bl
{% block ${1} %} {% block ${1} %}
${2} ${2}
{% endblock $1 %} {% endblock $1 %}
# twig javascripts # twig javascripts
snippet js snippet js
{% javascripts '${1}' %} {% javascripts '${1}' %}
<script src="{{ asset_url }}"></script> <script src="{{ asset_url }}"></script>
{% endjavascripts %} {% endjavascripts %}
# twig stylesheets # twig stylesheets
snippet css snippet css
{% stylesheets '${1}' %} {% stylesheets '${1}' %}
<link rel="stylesheet" href="{{ asset_url }}"> <link rel="stylesheet" href="{{ asset_url }}">
{% endstylesheets %} {% endstylesheets %}
# twig if # twig if
snippet if snippet if
{% if ${1} %} {% if ${1} %}
${2} ${2}
{% endif %} {% endif %}
# twig if ... else # twig if ... else
snippet ife snippet ife
{% if ${1} %} {% if ${1} %}
${2} ${2}
{% else %} {% else %}
${0} ${0}
{% endif %} {% endif %}
# twig else # twig else
snippet el snippet el
{% else %} {% else %}
${0} ${0}
# twig elseif # twig elseif
snippet eif snippet eif
{% elseif ${1} %} {% elseif ${1} %}
${0} ${0}
# twig for # twig for
snippet for snippet for
{% for ${1} in ${2} %} {% for ${1} in ${2} %}
${3} ${3}
{% endfor %} {% endfor %}
# twig extends # twig extends
snippet ext snippet ext
{% extends ${1} %} {% extends ${1} %}