Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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

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.