Reputation: 47
Is there a setting that automatically inserts whitespaces into the code when you enter a semicolon?
For example,
cout<<"Hello world!"<<endl
to
cout << "Hello world!" << endl;
If you type ;
in Visual Studio (as seen above), it will automatically insert whitespaces. Is there a setting similar to this in VS Code?
Upvotes: 0
Views: 1610
Reputation: 94
In Settings, under Text Editor
is "Formatting". In here, turn on "Format On Type". This will cause it to auto-format after putting in a semicolon.
If it still doesn't format it after this, you'll probably have to go under Extensions
to your language (which in this case is C/C++
), scroll down until you see C_Cpp > Vc Format
, and change any formatting you want.
Upvotes: 4