What's the best way to do word wrapping for a document in vim?I'd like have each line wrap at 80 characters, not just visually wrap but enter a newline.I got this kind of working by using:set wrap:set linebreakBut if I go back and insert text on a previous line, it doesn't adjust the rest of the paragraph.  It takes the overflow text and puts it on a newline, but the line that comes after doesn't get moved up to fill in the gap.So if I edit a previous line, my paragraph can look like thisA line that is 80 characters longshort lineA line that is 80 characters loneI want it to be like this:A line that is 80 characters longshort line A line that is 80characters long
Vim: word wrap for documents
vim;documents
wrap and linebreak control the display of text, I think you'll find they don't actually insert newlines in the file. To get vim to insert newlines in the file as you type, set textwidth to the desired width (e.g. 80).That will still not automatically reflow subsequent lines when you insert more text. I usually do that manually with gq}, but I just discovered that set formatoptions+=a will tell vim to do it automatically. See the help for auto-format.