Say I have a super long line in the VIM editor (say around 300+ characters). How would I break that up into multiple lines so that the word boundaries roughly break at 80 characters?
Example:
This is a really long line This is a really long line This is a really long line This is a really long line This is a really long line This is a really long line This is a really long line This is a really long line This is a really long line This is a really long line This is a really long line
to
This is a really long line
This is a really long line
This is a really long line
This is a really long line
This is a really long line
This is a ...
Best Answer
Vim does this very easy (break lines at word boundaries).
I'd suggest you check out
:help gq
and:help gw
.Also setting textwidth (
tw
) will give you auto line break when exceeded during typing. It is used ingq
too, though if disabledgq
breaks on window size or 79 depending on which comes first.By setting format options to include text width vim will automatically break at the tw setting.