Build and use code snippets, which are short templates that can be entered with a few keystrokes.
- [Instructor] VS code supports snippets,…which you can think of as smart fragments of code…that can be inserted by typing just a few characters.…This makes it easy to enter common code patterns…with less typing.…The app ships with several snippets already built in,…but you can also define your own.…In the editor, let's open the file named script.js,…which is in the scripts folder.…So let's add a function to this script file…by using the snippet.…When I type the letters fun…you can see that the completion list pops up.…
There's a couple of entries in here already…for the function keyword,…and this one down here with the box…and the little dots in the bottom is the one I want.…That icon indicates that this is a snippet.…Snippets have support for tab completion,…so if I select that snippet and then hit the Tab key…you can see that a skeleton of a function construct…has been inserted into the file.…There are place holders for the function name,…the parameters, and the body of the function.…
The name is already highlighted,…
Joe Marini kicks off the course by taking you through the app's user interface, and showing how to work with its basic editing features. Next, Joe demonstrates how to customize VS Code by configuring preferences, setting your own keyboard shortcuts, and working with snippets. He also explains how to maximize your productivity by installing and managing extensions from the Visual Studio Marketplace. Plus, he discusses how VS Code works with folders and collections of files, helps you understand the IntelliSense feature, and dives into the app's advanced code editing features, such as automatic formatting.
- Installing Visual Studio Code
- The VS Code UI
- Understand how VS Code works with built-in Git integration
- Customizing VS Code
- Configuring preferences
- Setting keyboard shortcuts
- Using extensions
- Working with snippets
- Using VS Code to edit different parts of the same file
- Using multiple selections
- Understanding how VS Code works with JSON files