When I load certain file types in vim, the corresponding ftplugin adds "co" (among other options). I don't want this.
One example is the bundled ruby.vim. I could do this one ftplugin at a time by copying the file to ~/.vim/ftplugin/ and changing the
set formatoptions line manually, but that is really inconvenient. Also, if I upgrade vim, I won't have the newest ftplugin files.
Is there a way to ignore only the "co" part for all ftplugins? Or maybe some way to have "set formatoptions-=co" run automatically after every ftplugin load?
Here's my enhancement of the accepted answer:
augroup myft au! au FileType * setlocal formatoptions-=c formatoptions-=o augroup END
This defines the autocmd in a group, so the group can be cleared in case .vimrc is sourced multiple times. Otherwise the same autocmd will keep getting appended.