Vim C++ Indentation Hack
It is possible to customize the behavior of cindent in Vim by writing a wrapper function. All you need is to find out which indentifiers Vim uses for calculating the new indent, and then find an appropriate regular expression.
Suppose we do not want to indent stuff in namespace declarations. I found out that it is enough to adjust the indentation of the first definition (except for a special case when using inheritance (“: public …“), see the code): continue reading…