Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modify default C++ snippets in VS Code

I would like to modify the default code snippets for C++ in Visual Studio Code. I've found a similar question here, but they actually show how to create your own snippets - and not how to modify the default snippets.

The reason I want to do this is because I'm used to doing some things a bit differently than how they are done in the snippets. For example, this is what appears when I use the if snippet:

if (/* condition */)
{
    /* code */
}

And I would like it to be like this:

if(/* condition */){
    /* code */
}

Is there any way to achieve what I want to do? Thank you.

like image 579
ARD Avatar asked May 31 '26 12:05

ARD


1 Answers

  1. Press Ctrl + ,(opens vs code settings);
  2. Type "snippet" in settings search bar;
  3. In Extentions List choose C/C++
  4. Untick "Suggest Snippets" button;
  5. Close settings tab.
  6. Go to settings again and create new User Snippets 😊as you liked.enter image description here
like image 76
Javokhir Farkhodov Avatar answered Jun 02 '26 01:06

Javokhir Farkhodov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!