%s/\(.\{250\}[^ ]* \)/\1 \\^M/gc
250 is an arbitrary number I picked, and the "^M" part is a newline entered in vim by pressing ctrl-v, ctrl-m. Also, I split the line where there was a space, because I knew the data had frequent spaces and I didn't want to split a word.
2 comments:
:%!fold -s -w 80
gql will also work, or highlight the text in visual mode (V) and type gq.
Post a Comment