Auto-comments are the most annoying feature of text editors and IDEs for me.I've searched -- nay, scavenged -- high and low to figure out how to get rid of literally any semblance of automatic comment continuation, and for whatever reason it's proving impossible and incredibly annoying.Right now, I have tried the following three lines, which works for most languages.autocmd BufNewFile,BufRead,FileType * set formatoptions-=croautocmd BufNewFile,BufRead,FileType * setlocal formatoptions-=croau FileType c,cpp setlocal comments-=:// comments+=f://But whenever I open a file that isn't considered C++ at first (i.e. not the correct extension) and use setf cpp, all auto-comments seem to come back to haunt me.Even sometimes opening a known-to-be-C++ file, this still happens. I'm not sure what the cause is, but it's aggravating.How on Earth can I tell vim that I really truly do not want auto-comments, ever, under any circumstances? I feel like I've been plagued by this for years.
Disable absolutely all auto-comments, for real
vimrc;neovim;autocmd;comments
The culprit is $VIMRUNTIME/ftplugin/c.vim, and likely all other standard ft plugins. If you want everything they define but the setting for 'formatoptions', I don't see any simple solution. (Just in case, $VIMRUNTIME is set within vim)May be, you could listen for OptionSet to prevent inserting cro in &fo. But beware of possible infinite loops. I've never tried it.BTW, I would have left 'comments' alone. This option could be used by plugins that toggle comments on blocks, or that generate documentation -- I actually use it in mu-template to insert license captions as comments, which ever the current language is.