From 7ecb2216a9297a9b58868ad65f25cb8c1d1fdaf9 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Fri, 1 Aug 2014 10:39:00 -0300 Subject: [PATCH] more django things (and a bit of "visual" use) --- UltiSnips/jinja.snippets | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/UltiSnips/jinja.snippets b/UltiSnips/jinja.snippets index cbf8f98..1f74824 100644 --- a/UltiSnips/jinja.snippets +++ b/UltiSnips/jinja.snippets @@ -1,4 +1,4 @@ -snippet if "If block" +snippet if "If block" i {% if ${1:condition} %} $0 {% endif %} @@ -10,6 +10,20 @@ snippet for "For loop" {% endfor %} endsnippet -snippet static "Django static route" -{% static "${1:path}" %} +snippet static "Django static route" i +{% static '$0' %} +endsnippet + +snippet url "Django URL resolver" i +{% url '$0' %} +endsnippet + +snippet csrf "Django CSRF token" +{% csrf_token %}$0 +endsnippet + +snippet spaceless "Remove spaces (uses visual)" +{% spaceless %} + ${0:${VISUAL}} +{% endspaceless %} endsnippet