Skip to content

Instantly share code, notes, and snippets.

@soniktrooth
Forked from rossluebe/Twig Snippets for Atom
Last active November 10, 2016 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soniktrooth/593722ae72a57cd1a5d06efaa8a09ce8 to your computer and use it in GitHub Desktop.
Save soniktrooth/593722ae72a57cd1a5d06efaa8a09ce8 to your computer and use it in GitHub Desktop.
Twig Snippets for Atom
'.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': '<pre>{{ dump( $1 ) }}$0</pre>'
'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