Context Navigation

Using Vim with Django

This page is intended to be used as a collection of hints for using the Vim editor with Django.

Vim Modeline

To insure that all developers are using a standard tab format (as long as they are using Vim), you can add a Vim modeline (special comment) to your files, to set people in the same mode for that file. Example:

The ​SnippetsEmu plugin for Vim 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.

One can add specific abbreviations for models or templates based on file contents. Adding the following line to your ~/.vim/ftplugin/python.vim file (create it if you don't have it) will allow you to define abbreviations just for models:

Such a structure can also be created by using the build in '\C' command which will recurse through the whole directory tree.

PIDA

Although this is not Django-specific (I don't think some of the other stuff in here is very Django-specific either), ​PIDA looks like a pretty nice IDE environment for VIM+Python, which would therefore help you out in Django :).