+5  A: 

More a direction than a solution.

Use 'formatexpr' or 'formatprg'. When a line exceeds 'textwidth' and passes the criteria set by the 'formatoptions' these are used (if set) to break the line. The only real difference is that 'formatexpr' is a vimscript expression, while 'formatprg' filters the line through an exterior program.

So if you know of a formatter that can do this transformation to lines of python code, or are willing to write one, this will give you a hook to have it executed. And since vim supports python (see :help python) you can even write your python formatter in python.

rampion
I tried writing a formatexpr, but I had trouble even getting it to run. I've searched and searched for examples or docs about writing one of these, but have consistently found barely anything.
vicfryzel
here's an example http://www.mail-archive.com/[email protected]/msg08443.html (see `autofmt.zip:autofmt/autoload/autofmt/compat.vim`)
rampion
here's another: http://www.mail-archive.com/[email protected]/msg00890.html
rampion