I use Vim for C and C++ coding. Following is my .vimrc:execute pathogen#infect()set backspace=indent,eol,startset shiftwidth=2set softtabstop=2set expandtabset smarttabset cino+=(0set statusline=set statusline +=\[%n]     buffer numberset statusline +=\%F       Fileset statusline +=%=%l/%L   currentLine/totalLineset statusline +=%4v       virtual columnset laststatus=2set numberset nowrapset ruler                  show the cursor position all the timeset scrolloff=7            start scrolling when cursor is 7 lines from top/bottomset t_Co=256set textwidth=80set formatoptions=croqlt   Hard-wrap when typing exceeds <textwidth>set hlsearchsyntax onfiletype plugin indent onautocmd FileType make set noexpandtab shiftwidth=4 softtabstop=0colorscheme torteI'm no expert vim scripter - the above is cobbled together from various google searches for the various behaviors I desired.I wanted auto linebreak at 80 chars so that text is intelligently wrapped at 80 chars (i.e. words are not chopped at the boundary, but a line of text is chopped at the nearest whitespace) - as I type. I was led to believe the above should do so, but it only works for comments, not code. E.g. following is what Vim displayed as I typed:#include <iostream>int main( int argc, char* argv[] ){  // Here's some C++-style comments. Happily, this line gets intelligently  // line-broken as I type.  int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, why_does_this_reach_this_far_without_linebreaking;  return 0;}Can anyone please advise what needs to be added to/corrected in my .vimrc?
Auto linebreak works on C++ comments but not code
vimrc;line breaks;filetype c++