Align C/C++ declaration, assignment, parameter, call, and macro blocks around the active cursor line.
Examples:
int a;
float b;becomes:
int a;
float b;MyStruct foobar = {1, 2, 3};
YourStruct bax = {};
HisStruct baz = {5};becomes:
MyStruct foobar = {1, 2, 3};
YourStruct bax = {};
HisStruct baz = {5};int lerp(
int a,
int b,
float r,
);becomes:
int lerp(
int a,
int b,
float r,
);int x = lerp(1, 2, 0.5f);
float xx = lerp(11, 22, 1);becomes:
int x = lerp(1, 2, 0.5f);
float xx = lerp(11, 22, 1 );#define FOO(X) \
X(a, 1, 2) \
X(aa, 11, 22) \
X(aaa, 111, 222)becomes:
#define FOO(X) \
X(a, 1, 2) \
X(aa, 11, 22) \
X(aaa, 111, 222)Align Whitespace: C/C++ Block
F1for*.cpp,*.cc,*.cxx,*.h,*.hpp
- The alignment logic is implemented in
python/align_cpp_block.py. - The extension shim in
extension.jsonly registers the VS Code command and invokes Python. - The default Python command is
python3. You can change it with thealignWhitespace.pythonCommandsetting.