0

I need to format following code

switch(i) {
    case 1: {
            printf("a");
            break;
        }

into:

switch(i) {
    case 1: 
        {
            printf("a");
            break;
        }

with keeping the k&r bracket style on other situations. How could I do this?

I have tried --style=kr --indent-cases

Jichao
  • 40,341
  • 47
  • 125
  • 198

1 Answers1

0

regex to replace:

s/\(case.*:\s\+\){/\1\r{/g
Jichao
  • 40,341
  • 47
  • 125
  • 198