Vim plugin to toggle Python function/method arguments between single- and multi-line
Question: I'm looking for a Vim plugin that can take a single-line statement like this:

    
    
    foo = self.some_method(param1="hi", param2="there")
    

and turn it into this:

    
    
    foo = self.some_method(
        param1="hi",
        param2="there"
    )
    

Big bonus points if it can append a comma to the last argument, like this:

    
    
    foo = self.some_method(
        param1="hi",
        param2="there",
    )
    

And finally I'd like to be able to turn the multi-line version back into a
single line, but just handling the single-to-multi-line scenario alone is
sufficient for me. Using `J` to re-join the line is fast enough most of the
time.

I'm **not** looking for a solution that formats like this:

    
    
    foo = self.some_method(param1="hi",
                           param2="there")
    


Answer: With this plugin:
[splitjoin.vim](https://github.com/AndrewRadev/splitjoin.vim). Using your
example you can get something like:

    
    
    foo = self.some_method(param1="hi", param2="there", param3="again")
    

with cursor between parenthesis, invoke using default maping `gS` :

    
    
    foo = self.some_method(param1="hi",
            param2="there",
            param3="again")
    

to return to the original just `gJ`

It work for many languages. For python you can split dicts, lists, tuples,
statements, imports

