Order | Area | TOCTitle | ContentId | PageTitle | DateApproved | MetaDescription | MetaSocialImage |
---|---|---|---|---|---|---|---|
introvideos |
Code Editing |
826efeef-6803-49bd-a500-06c6c42cda19 |
Edit and run code in Visual Studio Code |
11/16/2021 |
Learn the basics of editing and running code in VS Code. |
In this Visual Studio Code tutorial, we cover how to edit and run a small piece of code, including the features outlined below. After viewing this overview, read on in the Related Resources section to see more features.
<iframe src="https://www.youtube-nocookie.com/embed/MNBwGGwvvKE" width="640" height="320" allowFullScreen="true" frameBorder="0" title="Code editing in Visual Studio Code"></iframe>Here's the next video we recommend: Productivity Tips
Pick another video from the list: Introductory Videos
- Open a folder.
- File > Open Folder (
kb(workbench.action.files.openFolder)
)
- File > Open Folder (
- Use File Explorer to view the folder's files and subfolders.
- View > Explorer (
kb(workbench.view.explorer)
)
- View > Explorer (
- Install the Node.js runtime to execute JavaScript code.
- Find Node.js for your platform at https://nodejs.org
- Check your Node.js installation.
- From a terminal or command prompt, type
node --version
- From a terminal or command prompt, type
- Create new file.
- File > New File (
kb(workbench.action.files.newUntitledFile)
)
- File > New File (
- Create a simple "Hello world" console application called
app.js
. - IntelliSense provides suggestions as you type.
- Automatically format the source code.
- Format Document command (
kb(editor.action.formatDocument)
)
- Format Document command (
- Turn on Auto Save.
- File > Auto Save
- Display the Integrated Terminal.
- View > Terminal (
kb(workbench.action.terminal.toggleTerminal)
)
- View > Terminal (
- Split the terminal.
- Split Terminal (
kb(workbench.action.terminal.split)
)
- Split Terminal (
- Create new terminal.
- Create New Terminal (
kb(workbench.action.terminal.new)
)
- Create New Terminal (
- Run the application.
- From the Integrated Terminal, type
node app.js
- From the Integrated Terminal, type
- Productivity Tips -Become a VS Code power user with these productivity tips.
- Introductory Videos - Review the entire list of videos.
- Basic Editing - Learn about the powerful VS Code editor.
- Code Navigation - Move quickly through your source code.
- Emmet Snippets - Use Emmet Snippets.
- Tasks - Create tasks to use external tools inside VS Code.
- JavaScript Linters - Install linters for JavaScript.
- Code Folding - See the details of source code folding.
- Tips and Tricks - Helpful tips and tricks for VS Code.