01 · VS Code#
?> TL;DR ?> Visual Studio Code is a free, extensible code editor from Microsoft. It has ~75% developer market share in 2026 and runs locally, over SSH, inside Docker, and in the browser. It is your home base for the entire course.
Why VS Code?#
There are fancier editors (JetBrains PyCharm, Neovim), but VS Code wins because:
- It’s free and open source — no subscription, no vendor lock-in.
- Extension ecosystem — tens of thousands of extensions. Python + Jupyter + Docker + Remote-SSH all work together.
- Runs anywhere — local, over SSH to a GPU server, inside a Docker container, inside WSL, in a browser via code-server.
- Native AI assistance — GitHub Copilot, Claude, Gemini all have first-class VS Code integrations.
- You’ll see it in every job — it’s the editor of the industry.
Install VS Code#
Linux (Ubuntu / Debian)
sudo snap install --classic code
# Or with apt:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list
sudo apt update && sudo apt install codeWindows
winget install -e --id Microsoft.VisualStudioCodeOr download the installer from code.visualstudio.com.
After install, add the code command to your shell PATH (macOS/Linux already do this when installed via the methods above; on macOS with a .dmg, open VS Code and run Shell Command: Install ‘code’ command in PATH from the Command Palette).
The Command Palette — Your Superpower#
Press Cmd/Ctrl+Shift+P. This opens the Command Palette. Every feature in VS Code is reachable from here. When in doubt, search.
Common starting points:
| Command | What it does |
|---|---|
Python: Select Interpreter | Pick which Python / .venv to use |
Remote-SSH: Connect to Host... | Open a remote server’s files inside local VS Code |
Dev Containers: Reopen in Container | Develop inside a Docker container |
Jupyter: Create New Notebook | Start a .ipynb file |
Git: Clone | Clone a repo with a GUI prompt |
Must-Install Extensions for This Course#
Install these by pressing Cmd/Ctrl+Shift+X to open Extensions and searching:
| Extension | Publisher | Why |
|---|---|---|
| Python | Microsoft | Language support + Pylance + debugger |
| Jupyter | Microsoft | .ipynb notebooks inside VS Code |
| Ruff | Astral Software | Fast Python linter + formatter (replaces Black + Flake8) |
| Even Better TOML | tamasfe | pyproject.toml syntax highlighting |
| GitLens | GitKraken | Annotate every line with git blame info |
| Docker | Microsoft | Manage containers + Dockerfile linting |
| Remote - SSH | Microsoft | Edit files on a remote server as if local |
| Dev Containers | Microsoft | Containerized dev environments |
| GitHub Copilot | GitHub | AI autocomplete + agent mode (free tier available) |
| Mermaid Markdown Preview | bierner | Render Mermaid diagrams in markdown |
?> Install them all at once
?> Open the terminal and run:
?> bash ?> code --install-extension ms-python.python \ ?> --install-extension ms-toolsai.jupyter \ ?> --install-extension charliermarsh.ruff \ ?> --install-extension tamasfe.even-better-toml \ ?> --install-extension eamodio.gitlens \ ?> --install-extension ms-azuretools.vscode-docker \ ?> --install-extension ms-vscode-remote.remote-ssh \ ?> --install-extension ms-vscode-remote.remote-containers \ ?> --install-extension github.copilot \ ?> --install-extension bierner.markdown-mermaid ?>
Settings Sync#
Press Cmd/Ctrl+Shift+P → Settings Sync: Turn On. Sign in with GitHub. Now your extensions, keybindings, and settings follow you to any machine.
Essential Settings for Python#
Open settings.json (Command Palette → Preferences: Open User Settings (JSON)) and paste:
{
// Editor
"editor.formatOnSave": true,
"editor.rulers": [88, 120],
"editor.bracketPairColorization.enabled": true,
"editor.minimap.enabled": false,
// Python + Ruff
"python.analysis.typeCheckingMode": "basic",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.organizeImports.ruff": "explicit",
"source.fixAll.ruff": "explicit"
}
},
// Terminal
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.fontSize": 13,
// Files
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.exclude": {
"**/__pycache__": true,
"**/.pytest_cache": true,
"**/.ruff_cache": true
}
}Remote Development — The Killer Feature#
You can edit files on a remote machine (GPU server, cloud VM, Raspberry Pi) with VS Code running on your laptop. The editor is local, but the language servers, terminal, extensions, and debugger all run on the remote.
# Ensure your ~/.ssh/config has:
# Host gpu-box
# HostName 1.2.3.4
# User ubuntu
# IdentityFile ~/.ssh/id_ed25519
# Then in VS Code: Cmd+Shift+P → Remote-SSH: Connect to Host → gpu-boxThe first connect installs a small vscode-server on the remote. Subsequent connects are near-instant.
Jupyter Inside VS Code#
- Create a file
analysis.ipynb— VS Code opens it as a notebook. - Click Select Kernel → choose your Python from
.venvor your UV-managed env. - Run cells with Shift+Enter.
You get variable inspection, plot inline, Copilot completions per cell, and you can convert notebook ↔ .py with one command.
?> No more lost kernels
?> Before VS Code, notebooks meant either Classic Jupyter (separate browser) or JupyterLab. Today most data scientists run notebooks directly in VS Code because they can jump between .py files and .ipynb in the same window. Classic Jupyter is still great for quick one-off experiments on a remote server via browser.
AI Assistance — Copilot and Beyond#
In April 2026, VS Code’s AI features include:
- Inline suggestions — ghost-text completions as you type.
- Inline chat (Cmd/Ctrl+I) — edit-in-place with natural language.
- Chat view (Ctrl+Alt+I / Ctrl+Cmd+I) — conversation with context from your workspace.
- Agents — autonomous mode that reads files, edits across multiple files, runs commands, and self-corrects. In 2026, VS Code supports an Autopilot preview where agents approve their own actions.
Free tier: monthly inline suggestion and chat quota. Pro: $10/month unlimited.
?> Custom instructions
?> Create .github/copilot-instructions.md in your repo to give the AI project-wide conventions. Example:
?> markdown ?> - This is a Python 3.13 project using FastAPI and SQLModel. ?> - All new code must include type hints and a pytest test. ?> - Use Ruff rules; never use `black` or `isort`. ?>
Keyboard Shortcuts You Must Memorize#
On macOS use Cmd; on Linux/Windows use Ctrl.
| Shortcut | Action |
|---|---|
| Cmd+P | Quick open any file by name |
| Cmd+Shift+P | Command Palette |
| Cmd+B | Toggle sidebar |
| Cmd+` | Toggle terminal |
| Cmd+Shift+F | Search across all files |
| Cmd+D | Select next occurrence (multi-cursor!) |
| Alt+Click | Add another cursor |
| F2 | Rename symbol (safe across files) |
| F12 | Go to definition |
| Alt+F12 | Peek definition |
5-Minute Exercise#
- Install VS Code + the Python extension.
- Create a folder
hello-tds, open it in VS Code. - Create
hello.pywithprint("Hello, TDS!"). - Open the integrated terminal (Cmd/Ctrl+backtick) and run
python hello.py. - Install the Ruff extension. Save the file — confirm it formats.
- Commit to Git using the Source Control panel (no terminal needed).
If all six steps work, you’re ready for UV.
