EditorConfig is used to format codes. It's supported by visual studio natively.
Code styles in EditorConfig files
Go to Tools > Options > Text Editor > C/C++ > Code Style > General
. Click Generate .editorconfig file from settings
.
Add an EditorConfig file to a project
For C/C++, Solution/Project > Add > Existing Item...
, choose the dumped .editorconfig
file.
Code Cleanup (Ctrl+K, Ctrl+E), which applies any white space settings, such as indent style, and selected code style settings, such as how to sort using directives.
Edit > Advanced > Format Document (or Ctrl+K, Ctrl+D in the default profile), which only applies white space settings, such as indent style.
C++ EditorConfig formatting conventions
Some C++ editorconfig examples:
My .editorconfig conform to C++ Programming Style Guidelines