IDE for Django with GVim or PIDA

MacVim icon, glossy style

Image via Wikipedia

Extending the previous post IDE for Python with VIM to Django, here is what makes my final setup for Python/Django development: the good old GVim.

After installing GVim and tune it for Python development following this, you just have to make a combination of installing/configuring scripts and editing you vim configuration vimrc file. On my Debian box the Vim directory where the plugins/scripts and the vimrc file are is /etc/vim.

Here is my plugin folder:

minibufexpl.vim – a script that give tabs to Vim (I use it in GVim also)

NERD_tree.vim – filebrowser inside Vim

pythoncomplete.vim – ships with Vim 7

snipMate.vim – give you the ability to trigger code templates (snippets) from a word/characters followed by the <tab> key in INSERT mode. I think it’s one of the greatest Vim plugins. Please check the plugin link to learn about it and after that add Django snippets from robhudson. Trust me, after a little spin with this plugin you’ll se a huge boost in productivity in python, django and even django templates (don’t you “love” typing by hand those {{}} and {%%}? ).

taglist.vim – a source code browser. It doesn’t work with django snippets but i personally can live with that.

For the vimrc file there are lots of hacks online but i will give you an example with what i added to my vimrc file:

“” CYRUS STUFF

” To save, ctrl-s
nmap <c-s> :w<CR>
imap <c-s> <Esc>:w<CR>a

colorscheme desert
:syntax on
set tabstop=4
set smartindent
set shiftwidth=4
set expandtab

filetype on
filetype plugin on
filetype plugin indent on
set ofu=syntaxcomplete#Complete
autocmd FileType python set omnifunc=pythoncomplete#Complete

” Line numbers
set number
nnoremap <F2> :set nonumber!<CR>:set foldcolumn=0<CR>

” autostart NERDTree
autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p “put the cursor in the main window

” minibuffexlporer additional settings
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1

” taglist si ctags
let Tlist_Ctags_Cmd=’/usr/bin/ctags’
let Tlist_Use_Right_Window = 1

” Django si HtmlDjango snippets
autocmd FileType python set ft=python.django “For Snipmate
autocmd FileType html set ft=htmldjango.html “For Snipmate

There is one more tool that i use and that’s PIDA.

PIDA is a little different than a general IDE , it is a framework for integrated development because it works with different editors. I use PIDA with VIM, but you can use it with Emacs or medit.

Some people may argue that some can use just VIM or GVIM but what i like about PIDA is that you can have two or three shells inside the interface. The rest is just vim plugins and configurations (if you use Vim as the editor) plus some goodies that i let you discover.

Have fun!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s