简体   繁体   中英

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.

  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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM