Skip to content

Instantly share code, notes, and snippets.

@eQRoeil
Last active January 27, 2017 10:46
Show Gist options
  • Save eQRoeil/3fe8a4880a9c23c14f5b to your computer and use it in GitHub Desktop.
Save eQRoeil/3fe8a4880a9c23c14f5b to your computer and use it in GitHub Desktop.
Brackets : Emmet snippets pour Twig
{
"html": {
"filters":"html",
"extends":"html",
"snippets": {
"t_v": "{{ ${cursor} }}",
"t_c": "{# ${cursor} #}\n",
"t_block": "{% block $1 %}\n\t$2\n{% endblock %}\n",
"t_extends": "{% extends $1 %}",
"t_parent": "{{ parent() }}",
"t_set": "{% set $1 = $2 %}",
"t_set_e": "{% set $1 %}\n\t$2\n{% endset %}",
"t_spaceless": "{% spaceless %}\n\t$1\n{% endspaceless %}",
"t_if": "{% if $1 %}\n\t$2\n{% endif %}",
"t_ifelse": "{% if $1 %}\n\t$2\n{% else %}\n\t$3\n{% endif %}\n",
"t_import": "{% import '$1' as $2 %}",
"t_inc": "{% include '$1' %}\n",
"t_from": "{% from '$1' import $2 as $3 %}",
"t_for": "{% for $1 in $2 %}\n\t$3\n{% endfor %}",
"t_dump": "{{ dump($1) }}"
}
}
}

#Emmet snippets pour Twig (incomplet)

Twig doc http://twig.sensiolabs.org/documentation

##Utilisation

In brackets "Emmet" > "Preferences", définir le dossier pour les extensions Emmet

Inclure le fichier dans ce dossier puis recharger Brackets (F5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment