A lot of times, I have a list of initializers in some of my code, like this:
class Foo(object):
def __init__(self, data):
self.foo = data.getFoo()
self.bar = data.getBar()
self.something = data.getSomething()
As you can see, I like my code aligned like a table. In a lot of cases, the above code can be generated by scripting Vim, coming from the output of some other program (DESCRIBE "foo"; in a database for example). Unfortunately, the scripted output usually looks like this, first:
class Foo(object):
def __init__(self, data):
self.foo = data.getFoo()
self.bar = data.getBar()
self.something = data.getSomething()
So after the automatic generation of th assignment statements, I'll have to manually align all statements for the desired look.
Now: Is there a way to get vim to align those "second halves"of the statements automatically?