1

I know that I can format code in VSC by doing as in this link: How do you format code in Visual Studio Code (VSCode)

However, I want only the indentation and not other formatting. For example, I don't want the first { of the for-loop to end up on the row below the for. How do I do that?

Once again. When highlighting and formatting this piece of code:

int i;
for (i=0; i < 10; i++) {
    printf("hello\n");
}

I do NOT want this result:

int i;
for (i=0; i < 10; i++)
{
    printf("hello\n");
}

But I DO want this result:

int i;
for (i=0; i < 10; i++) {
    printf("hello\n");
}
Ashot Karakhanyan
  • 2,804
  • 3
  • 23
  • 28
Johan hvn
  • 318
  • 1
  • 2
  • 11

1 Answers1

0

Ctrl+k,Ctrl+f gives exactly the indent type you want. This works in java as far as I have tried.

Sidwa
  • 41
  • 1
  • 10