// tech tips · beginner
Set Up VS Code for Coding: A Beginner's Guide
Install Visual Studio Code, add the right extensions for Python, use the built-in terminal, and learn the keyboard shortcuts that save hours.
You can write code in Notepad, but a proper code editor makes everything easier: colours that make code readable, warnings before you even run your program, and a terminal built right in. Visual Studio Code (VS Code) is free, works on Windows, Mac and Linux, and is the most popular editor among developers. Here’s how to set it up properly from day one.
Step 1: Install VS Code
- Go to code.visualstudio.com and download the version for your computer.
- On Windows, during installation tick “Add ‘Open with Code’ action” for both files and folders. This lets you right-click any folder and open it in VS Code.
- On a Mac, drag the app into your Applications folder.
VS Code and Visual Studio are different products. Visual Studio is a much larger tool, mainly for Windows. For learning, VS Code is all you need.
Step 2: Open a folder, not just a file
VS Code works best when you open a whole project folder. Go to File → Open Folder and choose (or create) a folder such as coderunner. The Explorer panel on the left now shows every file inside it, and you can create new files with the small New File icon.
The first time, VS Code may ask “Do you trust the authors of the files in this folder?” Choose Yes for your own folders.
Step 3: Install the extensions you need
Extensions add support for each language. For Python, install these two. Click the Extensions icon in the left bar (four small squares), search, and click Install:
| Extension | Publisher | What it gives you |
|---|---|---|
| Python | Microsoft | Run and debug Python, error highlighting, autocomplete |
| Pylance | Microsoft | Faster, smarter autocomplete and type hints (usually installed with the Python extension) |
Always check the publisher. Popular extensions have look-alikes, and the official Microsoft ones are the safe choice.
Step 4: Use the built-in terminal
Press Ctrl + ` (the backtick key, usually under Esc) to open a terminal at the bottom of the window. It already starts in your project folder, so you can type commands such as:
python hello.py
On a Mac, the shortcut is Ctrl + ` as well. Having your code and terminal on one screen saves a lot of switching back and forth.
With the Python extension installed, you can also click the ▶ Run button in the top-right corner of any .py file.
Step 5: Turn on two time-saving settings
Open settings with Ctrl + , (Cmd + , on a Mac) and search for:
- Auto Save: set it to
afterDelay. You’ll never again run an old version of your file because you forgot to save, which is one of the most common beginner mix-ups. - Format On Save: tick it. Your code is tidied up every time it’s saved (for Python, also install the Black Formatter or autopep8 extension).
The shortcuts worth learning
You don’t need to memorise them all at once. Learn two a week.
| Action | Windows / Linux | Mac |
|---|---|---|
| Command Palette (find any command) | Ctrl + Shift + P | Cmd + Shift + P |
| Quick open a file | Ctrl + P | Cmd + P |
| Toggle terminal | Ctrl + | Ctrl + |
|
| Comment / uncomment line | Ctrl + / | Cmd + / |
| Move line up / down | Alt + ↑ / ↓ | Option + ↑ / ↓ |
| Copy line up / down | Shift + Alt + ↑ / ↓ | Shift + Option + ↑ / ↓ |
| Select next match | Ctrl + D | Cmd + D |
| Find in all files | Ctrl + Shift + F | Cmd + Shift + F |
| Rename everywhere | F2 | F2 |
The Command Palette is the one to learn first: if you can’t remember where a feature is, press it and type what you want, such as “format document” or “change theme”.
Bonus: make it comfortable
- Theme: Command Palette → “Color Theme”. Pick something easy on your eyes.
- Font size: Ctrl + = and Ctrl + - zoom the whole window in and out.
- Word wrap: Alt + Z wraps long lines so you don’t have to scroll sideways.
Key points
- Open a folder so VS Code can see your whole project.
- Install the official extension for each language you use.
- Use the built-in terminal (Ctrl + `) to run your code.
- Turn on Auto Save and Format On Save.
- When in doubt, use the Command Palette (Ctrl + Shift + P).
Now you’re set up, write your first program with Your First Python Program.