Is there a way to make Vim fold functions based on the syntax of a function declaration?
For example having vim turn a function like this:
def foobar(foo,bar):
if foo > bar:
print "foo"
elif foo < bar:
print "bar"
elif foo == bar:
print "foobar"
Into this:
+----- 7 lines: def foobar(foo,bar): -------------------------------------------------------------
Is there some set of commands or a function I can put into my .vimrc file use to accomplish this?