Python Bibliotheca
Python resources for teachers and students.

Using vim as a Python IDE

Here is a little .vimrc that makes vim an excellent Python IDE:

" .vimrc
"
" Created by Jeff Elkner 23 January 2006
" Last modified 2 February 2006
"
" Turn on syntax highlighting and autoindenting
syntax enable
filetype indent on
" set autoindent width to 4 spaces (see
" http://www.vim.org/tips/tip.php?tip_id=83)
set et
set sw=4
set smarttab
" Bind <f2> key to running the python interpreter on the currently active
" file.  (curtesy of Steve Howell from email dated 1 Feb 2006).
map <f2> :w\|!python %<cr>

[ Copyright 2006, Jeffrey Elkner ]

Comments, questions, or suggestions? Email the webmaster