Paul Drynoff wrote:
I mean vim load this setting from .vim/ftplugin/c.vim
but only when I start vim using:
vim +'set formatoptions=vt'
'formatoptions' determines which parts of the text you enter gets wrapped.
By default, in .c files, Vim wraps only comments, so if you try to enter
a comment longer than 30 chars, you should see it wrap.
From c.vim:
--8<--------------------
" Set 'formatoptions' to break comment lines but not other lines,
" and insert the comment leader when hitting <CR> or using "o".
setlocal fo-=t fo+=croql
--8<--------------------
By setting formatoptions=vt, you change that behavior, so that the code
part is wrapped as well.
HTH
Niels