Vim: How to reformat a set of lines into one line (if the line represents one sentence)?

Do not duplicate In Vim, what is the easiest way to combine all the lines in a file into one line? , since I specifically mean use gqthe format function.

I used latex in vim using 80 characters textwidth. However, now I have switched to infinite textwidth, so my lines go on forever.

Reformatting Vim (e.g. gqap) concatenates several lines into a paragraph, wrapping them with 80 characters. I would like him to combine them in one line.

t

Without a \clang{goto} statement in the HIR, we must instead use conditional
statements to check the iteration number.

should reformat to

Without a \clang{goto} statement in the HIR, we must instead use conditional statements to check the iteration number.

when it is highlighted, and gq.

+3
2

"J", depesz,

:set tw=9999

do 'gq'. .

+3

"J" ?

+3

Source: https://habr.com/ru/post/1718117/


All Articles