Nearby lessons

8 of 124

C - 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

  1. Go to code.visualstudio.com and click Download for Windows.
  2. Run the downloaded VSCodeUserSetup-x64-*.exe.
  3. Accept the licence and keep the default install location.
  4. On the Select Additional Tasks screen, tick these boxes:
OptionWhy it matters
Add "Open with Code" to file context menuRight-click any file to edit it
Add "Open with Code" to directory context menuRight-click a folder to open the whole project
Add to PATHLets you type code . in any terminal
  1. 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
CCode Cell
1# Ubuntu / Debian
2sudo snap install --classic code
3 
4# or, if you downloaded the .deb file
5sudo apt install ./code_*.deb
6 
7# Fedora
8sudo dnf install code
9 
10# macOS (with Homebrew)
11brew install --cask visual-studio-code
Output
code 1.9x.x from Microsoft installed

Verify the Installation

Open a terminal and check the version. This also confirms that code is on your PATH:

Example04
CCode Cell
1code --version
Output
1.95.3
f1a4fb101478ce6ec82fe9627c43efbf9e98c813
x64

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.

  1. Create a folder somewhere sensible, for example C:\c-practice or ~/c-practice.
  2. In VS Code choose File → Open Folder and select it.
  3. Or, from a terminal already inside that folder, simply run code .
Example05
CCode Cell
1mkdir c-practice
2cd c-practice
3code .
Output
(VS Code opens with c-practice as the project folder)

Shortcuts Worth Memorising

ShortcutAction
Ctrl + `Open / close the integrated terminal
Ctrl + NNew file
Ctrl + SSave (C will not compile unsaved changes)
Ctrl + Shift + PCommand Palette — run any VS Code command
Ctrl + Shift + XExtensions 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 Questions
Progress: 0 / 3