I don't think it's possible as is, you can work around that though.
For your current example you can set
:set cino={-s
This will reindent each {/} pair found to reduce the shift width setting. This will work on the example you gave:
switch (x)
{
case 1:
break;
case 2:
{
break;
}
}
But not on an example with more complex syntax:
switch (x)
{
case 1:
break;
case 2:
{
break;
if( 1 )
{
//stuff
}
}
}
Apparently, by looking at :h cindent, Vim prefers the curly brace on the same line as the statement.
So I would recommand using the following formatting instead:
switch (x) {
case 1:
break;
case 2: {
break;
}
}
With this, you can set cino=l1 and indent will be:
switch (x) {
case 1:
break;
case 2: {
break;
}
}
Again, it might not suit your coding style but AFAIK, it the best way to properly indent the case statement.
caseblocks so you can avoid them. – SibiCoder Jul 11 '16 at 03:37