I\'ve been programming Python with Vim for a while but one thing I haven\'t been able to figure out how to do it set it to auto indent to the level of the last open paren.>
This can be refined a bit, but should work 99% of the time. Add this in your .vimrc:
function! PythonEnterFunc()
let l:li = getline('.')
execute "normal! a\"
if l:li =~ '([^)]*$'
let l:pos = stridx(l:li, '(') + 1
for i in range(l:pos)
execute "normal! a\"
endfor
endif
endfunction
au FileType python inoremap :call PythonEnterFunc()a