benjamin.althu.es open source projects | blog

repository information was fetched from Github 7 years, 10 months ago

vim-djazz

A plugin that helps you write Django templates faster. Also, my first attempt at writing a Vimscript.

Installing

Installing is really simple if you use pathogen.vim

$ cd ~/.vim/bundle
$ git clone git://github.com/babab/vim-djazz.git

If you don't (want to) use pathogen.vim or similar plugins you can source the vim-djazz.vim file in your .vimrc after downloading it.

source /path/to/vim-djazz/plugin/vim-djazz.vim

Getting help while editing

If you use pathogen.vim make sure to run :Helptags at least once after installing to make sure the help file can be found.

Get help in Vim by running :help djazz

Creating Django specific template entities

Django tag

Create django {% tag %} (from current line).

{% name %}
  • normal mode keybindig: ;de
  • normal mode command: :DjangoTag
  • insert mode keysequence: {{T

Django 'variable' tag

Create Django {{ var }} (from current line).

{{ name }}
  • normal mode keybindig: ;dd
  • normal mode command: :DjangoVar
  • insert mode keysequence: {{V

Django block

Create block tag (from current line) and add endblock tag on next line.

{% block name %}
{% endblock %}
  • normal mode keybindig: ;dc
  • normal mode command: :DjangoBlock
  • insert mode keysequence: {{B

Django forloop

Create a forloop block, asking for name and iterator.

{% for iterator in name %}
{% endblock %}
  • insert mode keysequence: {{F

License

Copyright (c) 2012-2013 Benjamin Althues benjamin@babab.nl

Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

back to home

projects

about me

I am a computer enthusiast and software developer, passionate about free and open source software and Unix-like operating systems.

Copyright © 2015-2016 Benjamin Althues
The code for this website is released under an ISC License

dispass.org | simphplist.org | cloud.babab.nl