I've been having a ridiculously hard time getting C/C++ code folding to work with set foldmethod=syntax. To debug my issue I've stripped down my vimrc to only this:set foldmethod=syntaxsyntax on                 also tried putting this firstNow when I open a cpp file, nothing is folded.Then, doing :syntax off followed by :syntax on will fold the cpp file.Any idea why that does something not already done by the trivial vimrc?
Folding doesn't work for C/C++
syntax highlighting;folding;filetype c++;filetype c
After some detective work I tracked down the cause of my issue being that I had a .vim file in my plugin directory that redefined OperatorChars, which broke the syntax based folding for C and C++.