Changes between Initial Version and Version 1 of UsingVimWithDjango


Ignore:
Timestamp:
Jan 4, 2006, 4:08:08 AM (18 years ago)
Author:
Lllama
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UsingVimWithDjango

    v1 v1  
     1This page is intented to be used as a collection of hints for using the Vim editor with Django.
     2
     3== SnippetsEmu ==
     4
     5The [http://www.vim.org/scripts/script.php?script_id=1318 SnippetsEmu] plugin for Django allows one to define abbreviations which can be expanded into larger blocks of text.  The abbreviations can also contain place markers which can be 'jumped to' in a similar manner to the macros defined in TextMate on OS X.
     6
     7The following is a collection of Django specific abbreviations for use with the plugin (using the default start and end tags: '<' and '>'):
     8
     9Models:
     10
     11{{{
     12Iabbr addmodel class <>(meta.Model):<CR><><CR><CR>def __repr__(self):<CR>return "%s" % (<>,)<CR><CR>class META:<CR>admin = meta.Admin()<CR><CR>
     13Iabbr mcf meta.CharField(maxlength=<>)<CR><>
     14Iabbr mff meta.FileField(upload_to=<>)<CR><>
     15Iabbr mfpf meta.FilePathField(path=<>, match=<".*">, recursive=<False>)<CR><>
     16Iabbr mfloat meta.FloatField(max_digits=<>, decimal_places=<>)<CR><>
     17Iabbr mfk meta.ForeignKey(<>, edit_inline=<False>)<CR><>
     18Iabbr m2m meta.ManyToManyField(<>)<CR><>
     19Iabbr o2o meta.OneToOneField(<>)<CR><>
     20}}}
     21
     22Templates:
     23{{{
     24Iabbr fore {% for <entry> in <list> %}<CR>{{ <entry>.<> }}<CR><>{% endfor %}<CR><>
     25}}}
     26
     27== XML.vim ==
     28
     29The [http://www.vim.org/scripts/script.php?script_id=301 xml.vim] plugin is really useful for editing XML and HTML files.  It makes tag completion easy and allows you to bounce between start and end tags.
Back to Top