Merge pull request #744 from codeinabox/twig-tidy

Removed redundant UltiSnips for Twig
This commit is contained in:
Louis Pilfold 2016-05-27 15:15:55 +01:00
commit a233f7b5aa
2 changed files with 9 additions and 71 deletions

View File

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

View File

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