Is there a vimscript function that wraps text in a similar manner like gqgq
does?
For example, if I have the following string variable:
let txt = 'One foo, two bars and three bazes went up the hill'
I'd like to call something like:
let indent = 4
let textwith = 12
let wrapped = wrap(txt, indent, textwidth)
After the call, the value of wrapped
should be
One foo, two
bars and
three bazes
went up the
hill
Is there something that does that?
gq
) and copying it afterward.