A handy vim command I used today:
:.,/^\s*\]/join
.
: Specifies the current line as the start of the range.
/^\s*\]/
: Searches forward for the first line that starts (ignoring whitespace) with a closing bracket ]
.
join
: Joins all lines in the specified range into one line, inserting a space between them.