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