From the course: Learning Visual Studio Code

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Using built-in code snippets

Using built-in code snippets

Code Snippets are a really handy feature in Visual Studio Code. They can save you a few keystrokes, which is nice, but they can also alleviate the need to memorize lots of precise syntax. VS Code comes with lots of built-in Snippets, but also makes it straightforward to create your own for any programming languages you use. Let's see how to use built-in Snippets. You can insert Snippets a couple of different ways. The first I'll show you is with the command palette. I'll search for snippet. From this filtered list, I'll select "Insert Snippet." Because I currently have a JavaScript file open, I'm showing a list of JavaScript Snippets. This list would be different if I were working in a different programming language or file type. From here, I can scroll through the list of Snippets for things like functions, loops, and conditionals. Selecting one will add it to my code file. However, I'm going to cancel out of this and show you what I think is the more common way to insert a Snippet…

Contents