Let's assume I am editing some Python code in Vim that looks a bit like:
myobj.myfunc("Some string parameter that goes on and on and on and on and sometimes doesn't" "split very" "neatly over different lines so that" "it is formatted attractively")
I would prefer to reformat this so it reflows up to the
textwidth I have set:
myobj.myfunc("Some string parameter that goes on and on and " "on and on and sometimes doesn't split very " "neatly over different lines so that it is " "formatted attractively")
Is there an easy way to do this?
If this were a conventional text paragraph, gqip or similar would be useful, but this won't handle the quotes used to delinate the string.
Note: I am asking specifically about Python here, but ideally, this answer would be relevant for many types of programming language that allow string continuation.