Seven reasons why you should switch to Vim

So you want a better IDE for developing django, huh? Why not give good old vim a try?

Use pathogen to maintain your vim plugins (and sanity). Using this, you can clone the repositories listed here to .vim/bundle/ and start using them right away.

Also, consider adding your .vimrc and .vim to a repository. Include .vimrc inside .vim and symlink .vim/.vimrc to ~/.vimrc to version control your .vimrc.

My vim files can be found here. Also, here’s an imgur album demonstrating these plugins in action.

  1. Syntax highlighting for django templates

    Starting from vim 7.1, syntax highlight for django templates works out of the box. (Check your vim version using vim --version or :version within vim)

If you are on an older version, use this plugin

  1. Django snippets with snipmate

SnipMate provides commonly used “snippets”. This eliminates a lot of boiler plate code genreally required to start a django project from scratch.

Django specific snippets can be found at robhudson’s repository

Its very easy to write custom snippets in case you need them.

  1. On-the-fly error checking with pyflakes

This one is not django specific, but it can save a lot of time spent debugging typos or silly mistakes.

PyFlakes detects errors in your python code and highlights the offending lines so you can easily rectify them.

  1. Git integration with fugitive

Fugitive is a git plugin for vim.

This one integrates seamlessly with my workflow. You can add/reset files, commit them, view diff, blame, logs all within vim!

  1. Auto-completion using pysmell

Pysmell is great for autocompleting your django project code.

  1. Browse code with taglist

Taglist allows you to view your code structure and jump between classes/functions.

  1. Write faster html using sparkup

Sparkup allows you write zen code

Other tips:

  • set makeprg to python manage.py syncdb. Run :make from your vim to start syncdb

  • use nerdtree/lusty explorer for file management

  • use vimango for navigating your django project

Thank you for reading the Agiliq blog. This article was written by Javed on Nov 3, 2010 in vim .

You can subscribe ⚛ to our blog.

We love building amazing apps for web and mobile for our clients. If you are looking for development help, contact us today ✉.

Would you like to download 10+ free Django and Python books? Get them here