79358391

Date: 2025-01-15 13:30:25
Score: 2.5
Natty:
Report link

I have the same problem and have just figured out how to do it using vs code (to get the Whitesmith style). The way I did it was to use the vcFormat formatter rather than the default clang formatter. So go to settings in vscode (Ctrl ,) and edit the settings page (not the json page). I entered the search term 'format' and scrolled till I saw the setting

C_Cpp: Formatting

as seen in diagram below. screenshot of settings page showing where to change formatter type

I changed this from the default of clangFormat to vcFormat, then I changed a further two items. I actually changed them in the settings dialog, but for conciseness I am showing the changes in the following json version of the settings file:

"C_Cpp.vcFormat.indent.braces": true,
"C_Cpp.vcFormat.newLine.beforeOpenBrace.block": "newLine",

Finally I had to add the following two items to get it to work for me. These changes are also shown in their json page.

"editor.tabSize": 2,
"editor.detectIndentation": false
Reasons:
  • Blacklisted phrase (1): I have the same problem
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): I have the same problem
Posted by: Paulus