Javed
Comments
Reactions

Seven reasons why you should switch to Vim

By : Javed Khan

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

2. 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.

3. 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.

4. 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!

5. Auto-completion using pysmell

Pysmell is great for autocompleting your django project code.

6. Browse code with taglist

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

7. 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


Related Posts


Can we help you build amazing apps? Contact us today.

Topics : django vim

Comments

Stephen Zabel 4th Nov., 2010

Looking at your github CalVIM, there is one part that breaks. In the bundles submodules (in both .gitmodules and .git/config) the urls your two repos (django_snippets and vimango) tyr to use your private key. I needed to change git@github.com:tuxcanfly/snipmate_for_django.git to http://github.com/tuxcanfly/snipmate_for_django.

Other than that, thanks for sharing :) I just needed to add zenburn to the colors and it was perfect.

commmenttor
Javed

@Stephen zenburn looks good, thanks!

commmenttor
Bala Subramanyam 11th April, 2012

Nice article, also it will be good have your .vim folder available for the download

commmenttor

Reactions

cstrap

RT@samirmamude: Seven reaons why you should switch to Vim http://bit.ly/bYf2kF

commmenttor
bradcater

vim and Django: http://bit.ly/a3p7qx

commmenttor
wPythonnews

Seven reasons why you should switch to Vim - The Agiliq Blog http://bit.ly/aarbxt

commmenttor
aribeiro

RT@samirmamude: Seven reasons why you should switch to Vim http://bit.ly/9OxAb5

commmenttor
zodman

7 reason to use vim + django http://icio.us/zfcsdc

commmenttor
tyrionlannister

The title is inaccurate; this is not a comparison. Also, these features are not unique.

commmenttor
sisyphus

I'll do it for you here, following their format 1. syntax highlighting for just about every language known to mankind. 2. multiple snippets packages to choose from 3. on the fly error checking with pyflakes, as a bonus integration with pep8.py, pylint, nosetests, ipython, pdb 4. integrated with every version control system - autodetects when a file is under version control and gives you an abstracted set of commands that is consistent for all of them. or choose from magit, mercurial.el or other third party vc systems. 5. auto-completion using your choice of Ropemacs, pysmell, ipython and other backends that haven't been invented yet via generic auto-complete frameworks like AutoComplete and Anything 6. comes with tags integration, or use etags or gtags if you feel like 7. write faster html using nxhtml mode, validate your xhtml and html5 using a parser written by xml co-creator James Clark via nxml mode, view svg files inline then C-c C-c to see their source 8. BONUS - look up documentation for python from within emacs using pylookup (or eldoc mode) and the browser built into emacs. run an ipython shell from within emacs and send highlighted regions of code or entire buffers to it for evaluation, etc. etc.

commmenttor
dysmas

which one?

commmenttor
IthinkIthink

I find that an IDE is usually bloated and overkill, but that's just me. Vim can take a bit of getting used to, but there are very few things you need to know for using it daily; and you can continually add new plugins and tricks as you become more comfortable, similar to a chef adding new recipes to a cookbook.

commmenttor
ZaphodBB

Django + Vim*Plugins = Happy Fingers

commmenttor
f4nt

Or I can do this exact same thing with just about any other text editor. Cool, you like Vim, enjoy it. I don't like vim, I want a mouse on the rare occasion to be useful to me. I primarily use TextMate, but I also use Vim for quick edits and hacking on servers. When it comes to actual development, Vim just gets in my way too much.

commmenttor
esteban108

+1 for PyCharm

commmenttor
fas2

If you stick 2 full days with it (and look up whatever you need), you will have overcome the worst part.

commmenttor
fas2

The gazillion plugins are all chosen individually to maximize comfortability and speed. Totally worth it.

commmenttor
importthis

I read alot about Python + Vim, also Django + Vim. I installed Vim, tweaked it, but the learning curve still feels huge after a few weeks of sporadic, non-exclusive use. I still feel more productive with gedit and a few open terminals.

commmenttor
va1en0k

can wait till someone writes a same post for Emacs

commmenttor
swaroopch

RT@tuxcanfly:@swaroopch I prefer NERDTree, pathogen and taglist. My .vimrc - http://t.co/1Vqww6T. Also, my post on django dev in vim http://t.co/aBZCntc

commmenttor
tuxcanfly

@swaroopch I prefer NERDTree, pathogen and taglist. My .vimrc - http://t.co/1Vqww6T. Also, my post on django dev in vim http://t.co/aBZCntc

commmenttor
cubafran

#django, Seven reasons why you should switch to Vim http://is.gd/jIpzp /lleva tremenda pincha, pero me gustaria probar

commmenttor
mviera

Seven reasons why you should switch to Vim http://icio.us/zfcsdc

commmenttor
Post a comment Name :

Email :

Your site url:

Comment :

© Agiliq, 2009-2012