autocmd FileType text set textwidth=75
autocmd FileType text set formatoptions+=a
autocmd FileType text set formatoptions+=w
explanation:
- formatoptions+=a: auto-format as you insert text, which means it will (basically) automatically insert a newline once you've typed 'textwidth' number of characters on your line. it will insert a newline while you are typing.
- formatoptions+=w: this isn't necessary, but it has an effect on the way the auto-formatting is done. i find the 'w' options more convenient. With 'w', a linebreak means a new paragraph, unless trailing whitespace at end of line. It means that the 'a' option doesn't auto join lines separated by a linebreak.
- if you're not familiar with Vim's autocmds, what they're doing in the above definitions is setting those options for any text files that are opened (and only text files).