Many times, I have a list of initializers in some of my code, for example:
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 similar to a table. In many cases, the above code can be generated using the Vim script coming from the output of some other program ( DESCRIBE "foo";in the database, for example). Unfortunately, the output script 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 assignment operators, I have to manually align all the instructions for the desired appearance.
Now: is there a way to get vim to automatically align these two halves of statements?
source
share