With my default settings, theformatoptions
flag is tcq
for text files, and croql
for C++. I don't like that it autowraps the text, so I put this into my vimrc:
autocmd FileType text set formatoptions-=t
So far, this works as expected. Now I want to turn on comment joining on C++, so I add the following line to my vimrc just after the above line:
autocmd FileType c,cpp set formatoptions+=j
Now the formatoptions
becomes croqlj
for every file, not just C/C++, but also for text. Why is this?