I've done some searching with various keywords, but unsuccessfully. Sorry for my English, I'm not a native speaker.
I'm new to VIM and to Python, and I'm learning both on the go as much as I can, but sometimes I hit a brick wall and land here. Though SE already answered most of my questions, hence this is my first one.
While I'm not sure if it's even possible (why am I the only junior Python programmer searching/asking for that?), I'd like to know for sure without learning the whole scripting language beforehand and discovering it's not.
To the point:
When I'm writing a new class in Python I have to write:
class TestClass(object):
def __init__(self, arg1, ..., argn, namedarg1 = defaultvalue, namedarg2 = "default string value", namedarg3, ... namedargn):
self.arg1 = arg1
...
self.argn = argn
self.namedarg1 = namedarg1
self.namedarg2 = namedarg2
self.namedarg3 = namedarg3
...
self.namedargn = namedargn
... which seems a terrible waste of time, especially once I've heard about vim macros, snippets, autocorrect, etc.
What would be the best way to automate change from, let's say, this:
Testclass(arg1, ..., argn, namedarg1 = defaultvalue, namedarg2 = "default string value", namedarg3, ... namedargn)
to the first example I showed? How would it work (i.e. how do I use it; bonus points for explaining how would the macro/script/snippet work)?