Nearby lessons
8 of 124C - Install VS Code
Step-by-step guide to installing Visual Studio Code for C programming on Windows, Linux and macOS — including the installer options that matter and how to open your first project folder.
What VS Code Is (and Is Not)
Visual Studio Code is a free, lightweight code editor made by Microsoft. It gives you syntax colouring, autocomplete, a file explorer, a built-in terminal and a debugger.
VS Code cannot compile C by itself. It is an editor, not a compiler. Installing it is step one of two — the compiler comes in the next lesson.
Installing on Windows
- Go to code.visualstudio.com and click Download for Windows.
- Run the downloaded
VSCodeUserSetup-x64-*.exe. - Accept the licence and keep the default install location.
- On the Select Additional Tasks screen, tick these boxes:
| Option | Why it matters |
|---|---|
| Add "Open with Code" to file context menu | Right-click any file to edit it |
| Add "Open with Code" to directory context menu | Right-click a folder to open the whole project |
| Add to PATH | Lets you type code . in any terminal |
- Click Install, then Finish.
In simple words: the "Add to PATH" tick box is the one that saves you the most time later. Do not skip it.
Installing on Linux and macOS
Ubuntu / Debian — install the Snap package or the downloaded .deb:
Example03
Verify the Installation
Open a terminal and check the version. This also confirms that code is on your PATH:
Example04
Open a Folder, Not a File
This is the habit that prevents most beginner confusion. VS Code's C tooling stores its settings inside a .vscode folder in your project, and that only works if a folder is open.
- Create a folder somewhere sensible, for example
C:\c-practiceor~/c-practice. - In VS Code choose File → Open Folder and select it.
- Or, from a terminal already inside that folder, simply run
code .
Example05
Shortcuts Worth Memorising
| Shortcut | Action |
|---|---|
Ctrl + ` | Open / close the integrated terminal |
Ctrl + N | New file |
Ctrl + S | Save (C will not compile unsaved changes) |
Ctrl + Shift + P | Command Palette — run any VS Code command |
Ctrl + Shift + X | Extensions panel |
Trainer's Note: On macOS swap
Ctrl for Cmd. The backtick shortcut for the terminal is the one you will press hundreds of times — it is the key just above Tab.📝 Key Takeaways
- VS Code is a free editor from Microsoft — it is not a compiler.
- On Windows, tick "Add to PATH" and both "Open with Code" options.
- Always open a FOLDER, not a single file.
- Ctrl + ` opens the built-in terminal, where you compile and run.
🧠 Test Your Knowledge
3 QuestionsProgress: 0 / 3