sponsor Vim development Vim logo Vim Book Ad

vim_django : [UNMAINTAINED] Simplifies opening related files in Django projects

 script karma  Rating 9/3, Downloaded by 623    Comments, bugs, improvements  Vim wiki

created by
Anders Schau Knatten
script type

This script simplifies opening of related files in Django projects.

If you are editing a file in a Django project, vim_django will find the location of your template files and app files. In combination with the Command-T plugin: vimscript #3025, this makes it super-easy to open files related to the one you are currently editing.

Watch a demo on Viemo: http://vimeo.com/24394421 (1:24) (This only shows opening of template files, but files in the app itself can be opened in the same way)

Suggested mapping:
map <Leader>dt :VimDjangoCommandTTemplate<CR>
map <Leader>da :VimDjangoCommandTApp<CR>

If you put that line in your .vimrc, hitting "<Leader>dt" while working on a Django application will start CommandT in the template directory corresponding to the application. Hitting "<Leader>da will start CommandT in the app directory. ("<Leader>" is usually mapped as "\" or "," so try "\dt" or ",dt".)

If you have any questions, please send me an email at anders AT knatten DOT org
install details

Unpack in your .vim directory:

cd ~/.vim
tar zxf vim_django-<version>.tgz

The result should look like this:

You also need to install Command-T: http://www.vim.org/scripts/script.php?script_id=3025
(You can skip this if you don't want Command-T integration, but vim_django is pretty pointless without it. )

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim_django-0.5.tgz 0.5 2011-11-03 7.0 Anders Schau Knatten Don't crash if __file__ is used in settings.py
Remove python warning
vim_django-0.4.tgz 0.4 2011-11-02 7.0 Anders Schau Knatten Now  supports being installed via vundle, thanks to https://github.com/Psycojoker
vim_django-0.3.tgz 0.3 2011-10-04 7.0 Anders Schau Knatten Improved error handling with improved user feedback.
Fixed infinite loop when hitting root directory while looking for a file.
vim_django-0.2.tgz 0.2 2011-06-16 7.0 Anders Schau Knatten Can now open files in the app directory (like views.py, models.py) in addition to files in template directory.
vim_django-0.1.tgz 0.1 2011-05-29 7.0 Anders Schau Knatten Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo