In C++, I always align parameters on the open bracket (using clang-format). When I press the Enter key after that, the cursor always jumps to align with the indentation of the previous line by 4 spaces.
I have disabled all extensions to test for potential interference.
int main(int argc,
char **argv) {
_ <- cursor here
}
And what I want is, after pressing Enter, the cursor only indents 4 spaces.
int main(int argc,
char **argv) {
_ <- cursor should be here
}
I have tried and it meets the expected results in Sublime Text.
VS Code behavior: Gif
Sublime Text behavior: Gif
I tried to modify "auto-indent", but this setting cannot achieve my goal. Is there a way to change the behavior of VS Code to be like Sublime Text?
Enterkey. I am looking for a way to do it automatically.