I have a python file type setup in Vim. When I hit F9, it saves the file and executes it in a python shell.
My _vimrc: filetype on autocmd FileType python call FileType_Python() " Python coding function! TryPython() :w! :!python % endfunction function! FileType_Python() map <F9> :call TryPython()<cr> map! <F9> <esc>:call TryPython()<cr> set makeprg=python\ % set errorformat=\ \ File\ \"%f\",\ line\ %l, so ~/vimfiles/indent/python.vim so ~/vimfiles/bike.vim so ~/vimfiles/python_calltips.vim endfunction -- http://mail.python.org/mailman/listinfo/python-list