forked from honza/vim-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request honza#299 from chrisyue/master
add twig snippets
- Loading branch information
Showing
2 changed files
with
68 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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}' %} | ||
<script src="{{ asset_url }}"></script> | ||
{% endstylesheets %} | ||
endsnippet | ||
|
||
snippet if "twig if" b | ||
{% if ${1} %} | ||
${2} | ||
{% endif %} | ||
endsnippet | ||
|
||
snippet for "twig for" b | ||
{% for ${1} in ${2} %} | ||
${3} | ||
{% endfor %} | ||
endsnippet | ||
|
||
snippet ext "twig extends" b | ||
{% extends ${1} %} | ||
endsnippet |