0

Okay, I'm stuck! At the moment, when I pressing tab, my code is complemented basic constructs(e.g if, for, while). This snippets(as I know), not formatting code. Curly brackets inserted a new line like this:

if()
{
    /* code */
}
for()
{
    /* code */
}

It irritates me. I need this:

if() {
    /* code */
}
for() {
    /* code */
}

How do I do it? Need to change snippets or it's easier? This is not a formatting of already written code, so this solutions did not help me.
Install extension in vscode:

  1. ms-vscode.cpptools
  2. austin.code-gnu-global
tadman
  • 200,744
  • 21
  • 223
  • 248
  • The snippets are editable, and you can override rules. You just need to check the documentation. – tadman Jan 18 '21 at 11:43
  • Check Tools-->Options-->Text Editor-->(language)-->New Lines. If that doesn't work, check if you have a .clang-format file somewhere in the same directory or a parent directory that is controlling your auto-format settings. – c.fogelklou Jan 18 '21 at 12:08
  • Ask on the VS code forum – 0___________ Jan 18 '21 at 13:34

0 Answers0