Skip to content
Sublime Text 2 Django Snippets
Latest commit d2958bf Feb 21, 2011 Nick Lang updating readme to have the two new snippets
Failed to load latest commit information.
.gitignore Ignored cache files. Feb 12, 2011
HTML (Django).tmLanguage Initial commit Feb 11, 2011
README.rst updating readme to have the two new snippets Feb 21, 2011
autoescape.sublime-snippet Initial commit Feb 11, 2011
block.sublime-snippet Initial commit Feb 11, 2011
blocktrans.sublime-snippet Initial commit Feb 11, 2011
comment.sublime-snippet Initial commit Feb 11, 2011
context_variable.sublime-snippet Fix description and make a CDATA on a single line Feb 14, 2011
csrf_token.sublime-snippet Initial commit Feb 11, 2011
cycle.sublime-snippet Initial commit Feb 11, 2011
debug.sublime-snippet Initial commit Feb 11, 2011
ext.sublime-snippet Initial commit Feb 11, 2011
extends.sublime-snippet Initial commit Feb 11, 2011
extrahead.sublime-snippet Initial commit Feb 11, 2011
extrastyle.sublime-snippet Initial commit Feb 11, 2011
filter.sublime-snippet Initial commit Feb 11, 2011
firstof.sublime-snippet Initial commit Feb 11, 2011
for.sublime-snippet Initial commit Feb 11, 2011
fore.sublime-snippet Initial commit Feb 11, 2011
generic_template_tag.sublime-snippet new snippet for generic template tags Feb 21, 2011
if.sublime-snippet Initial commit Feb 11, 2011
ifchanged.sublime-snippet Initial commit Feb 11, 2011
ife.sublime-snippet Initial commit Feb 11, 2011
ifelse.sublime-snippet Initial commit Feb 11, 2011
ifeq.sublime-snippet Initial commit Feb 11, 2011
ifequal.sublime-snippet Initial commit Feb 11, 2011
ifnotequal.sublime-snippet Initial commit Feb 11, 2011
inc.sublime-snippet Initial commit Feb 11, 2011
include.sublime-snippet Initial commit Feb 11, 2011
load.sublime-snippet Initial commit Feb 11, 2011
now.sublime-snippet Initial commit Feb 11, 2011
regroup.sublime-snippet Initial commit Feb 11, 2011
spaceless.sublime-snippet Initial commit Feb 11, 2011
ssi.sublime-snippet Initial commit Feb 11, 2011
super.sublime-snippet Initial commit Feb 11, 2011
templatetag.sublime-snippet Initial commit Feb 11, 2011
trans.sublime-snippet Initial commit Feb 11, 2011
url.sublime-snippet Initial commit Feb 11, 2011
widthratio.sublime-snippet Initial commit Feb 11, 2011
with.sublime-snippet Initial commit Feb 11, 2011

README.rst

Sublime Text 2 Django Snippets

Overview

This is the first part of a set of snippets for Sublime Text 2 to use in Django templates. At the moment it includes snippets for all standard Django templates tags.

Installation

  1. Clone this repo
  2. Put the contents of this repo directly inside:
  • OS X: ~/Library/Application Support/Sublime Text 2/Packages/HTML (Django)/
  • Windows: %APPDATA%/Sublime Text 2/Packages/HTML (Django)/
  • Linux: ~/.Sublime Text 2/Packages/HTML (Django)/
  1. Don't forget to turn on django mode View → Syntax → HTML (Django)
  2. That's it, you can use the snippets now.

Snippets list

Abbreviation Tag
autoescape {% autoescape %} {% autoescape %}
block {% block %} {% endblock %}
comment {% comment %} {% endcomment %}
csrf_token {% csrf_token %}
cycle {% cycle %}
debug {% debug %}
ext {% extends "" %}
extends {% extends "" %}
filter {% filter %} {% endfilter %}
firstof {% firstof %}
for {% for in %} {% endfor %}
fore {% for in %} {% empty %} {% endfor %}
if {% if %} {% endif %}
ifchanged {% ifchanged %} {% endifchanged %}
ife {% if %} {% else %} {% endif %}
ifelse {% if %} {% else %} {% endif %}
ifeq {% ifequal %} {% endifequal %}
ifequal {% ifequal %} {% endifequal %}
ifnotequal {% ifnotequal %} {% endifnotequal %}
inc {% include %}
include {% include %}
load {% load %}
now {% now "" %}
regroup {% regroup by as %}
spaceless {% spaceless %} {% endspaceless %}
ssi {% ssi %}
templatetag {% templatetag %}
url {% url %}
widthratio {% widthratio %}
with {% with as %} {% endwith %}
trans {% trans %}
blocktrans {% blocktrans with as %} {% endblocktrans %}
{ {{ }}
% {% %}

...and some non-official stuff:

Abbreviation Tag
super {{ block.super }}
extrahead {% block extrahead %} {% endblock extrahead %}
extrastyle {% block extrastyle %} {% endblock extrastyle %}

Hints

You can use the Tab key to move the cursor to next logical position. For example use the for snippet and hit Tab to see how the cursor moves.

Something went wrong with that request. Please try again.