Created
May 7, 2014 20:09
-
-
Save rossluebe/f9015a1313d84b9604b8 to your computer and use it in GitHub Desktop.
Twig Snippets for Atom
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'.text.html.twig': | |
'Tag Print': | |
'prefix': '}}' | |
'body': '{{ $1 }}$0' | |
'Tag Block': | |
'prefix': '%%' | |
'body': '{% $1$2 %}$0{% end$1 %}' | |
'Tag Block (Block)': | |
'prefix': '%%' | |
'body': '{% $1$2 %}\n $0\n{% end$1 %}' | |
'Tag Comment': | |
'prefix': '##' | |
'body': '{# $1 #}$0' | |
'Dump': | |
'prefix': 'dump' | |
'body': '{{ dump( $1 ) }}$0' | |
'Extends': | |
'prefix': 'extends' | |
'body': '{% extends \'${1:template}\' %}$0' | |
'Includes': | |
'prefix': 'inc' | |
'body': '{% include \'${1:template}\' ${2:with ${3:vars}${4: only}} %}$0' | |
'Set': | |
'prefix': 'set' | |
'body': '{% set ${1:var} = ${2:value} %}$0' | |
'Set (Block)': | |
'prefix': 'setb' | |
'body': '{% set ${1:var} %}\n $0\n{% endset %}' | |
'Block': | |
'prefix': 'block' | |
'body': '{% block ${1:name} %}$0{% endblock %}' | |
'Block (Block)': | |
'prefix': 'blockb' | |
'body': '{% block ${1:name} %}\n $0\n{% endblock %}' | |
'Filter': | |
'prefix': 'filter' | |
'body': '{% filter ${1:name} %}$0{% endfilter %}' | |
'Filter (Block)': | |
'prefix': 'filterb' | |
'body': '{% filter ${1:name} %}\n $0\n{% endfilter %}' | |
'If': | |
'prefix': 'if' | |
'body': '{% if ${1:condition} %}$0{% endif %}' | |
'If (Block)': | |
'prefix': 'ifb' | |
'body': '{% if ${1:condition} %}\n $0\n{% endif %}' | |
'If': | |
'prefix': 'ife' | |
'body': '{% if ${1:condition} %}\n $2\n{% else %}\n $0\n{% endif %}' | |
'For': | |
'prefix': 'for' | |
'body': '{% for ${1:item} in ${2:seq} %}\n $0\n{% endfor %}' | |
'For Else': | |
'prefix': 'fore' | |
'body': '{% for ${1:item} in ${2:seq} %}\n $3\n{% else %}\n $0\n{% endfor %}' | |
'Else': | |
'prefix': 'else' | |
'body': '{% else %}\n $0' | |
'Filter': | |
'prefix': 'filter' | |
'body': '{% filter ${1:name} %}$0{% endfilter %}' | |
'Filter (Block)': | |
'prefix': 'filterb' | |
'body': '{% filter ${1:name} %}\n $0\n{% endfilter %}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, man. I was writing my own Twig snippets when came across your collection.