is it vi or vim?
note following is from .vimrc file:
augroup cprog
" Remove all cprog autocommands
au!
" When starting to edit a file:
" For *.c and *.h files set formatting of comments and set C-indenting on.
" For other files switch it off.
" Don't change the order, it's important that the line with * comes first.
autocmd BufRead * set formatoptions=tcql nocindent comments&
autocmd BufRead *.c,*.cc,*.h set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,://
augroup END
|