Install
Installing VS Code, pinning settings, syncing across machines, and verifying you have the editor you intended.
VS Code — install + sync
EXAMPLE
# ===== 1. Install =====
# macOS
brew install --cask visual-studio-code
# Linux (Ubuntu / Debian)
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -D -o root -g root -m 644 microsoft.gpg /etc/apt/keyrings/microsoft-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/code stable main" \
| sudo tee /etc/apt/sources.list.d/vscode.list
sudo apt update && sudo apt install code
# Windows (winget)
winget install --id Microsoft.VisualStudioCode -e
# Verify:
code --version
# 1.92.x
# <commit sha>
# x64
# ===== 2. Launch from the command line =====
# macOS: install the 'code' shell command from Command Palette:
# View -> Command Palette -> 'Shell Command: Install code command in PATH'
code . # open current folder
code -r . # reuse current window
code --diff a.txt b.txt # diff view
code -g src/x.ts:42 # open at line 42
# ===== 3. Pin extensions for a project =====
# .vscode/extensions.json (committed):
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"ms-azuretools.vscode-docker",
"streetsidesoftware.code-spell-checker"
]
}
# VS Code prompts new collaborators to install these on open.
# ===== 4. Per-project settings =====
# .vscode/settings.json (committed):
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": { "source.organizeImports": "explicit" },
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.tsdk": "node_modules/typescript/lib",
"files.eol": "\n",
"files.trimTrailingWhitespace": true
}
# ===== 5. User settings =====
# Command Palette -> 'Preferences: Open Settings (JSON)'.
# Lives at ~/Library/Application Support/Code/User/settings.json (mac) or
# %APPDATA%/Code/User/settings.json (Windows).
# Useful starting set:
{
"workbench.startupEditor": "none",
"editor.fontFamily": "JetBrains Mono, Menlo, Consolas, monospace",
"editor.fontSize": 13,
"editor.minimap.enabled": false,
"editor.cursorBlinking": "phase",
"editor.inlineSuggest.enabled": true,
"explorer.confirmDragAndDrop": false,
"terminal.integrated.defaultProfile.osx": "zsh"
}
# ===== 6. Settings Sync =====
# Command Palette -> 'Settings Sync: Turn On'.
# Pick what to sync (Settings, Keybindings, Extensions, Snippets, UI State).
# Auth via GitHub or Microsoft. Per-machine signed-in; settings stream.
# ===== 7. Insiders vs stable =====
# Insiders runs alongside stable, separate config dir.
# Use Insiders to test extension updates before they hit stable.
# ===== 8. CLI extensions =====
# Install / list / disable from the shell:
code --install-extension dbaeumer.vscode-eslint
code --list-extensions
code --disable-extensions # launch with no extensions (debug)
# ===== 9. Verify a clean install =====
# - Open a fresh folder; .vscode/extensions.json prompt appears
# - Format on save works
# - Settings Sync shows 'Synced just now'
# - 'code --version' matches the version you intended
# ===== Patterns to internalise =====
# - Commit .vscode/extensions.json and .vscode/settings.json per project
# - Keep user settings minimal; project settings should override only where needed
# - Settings Sync across personal machines; do not sync to shared/admin accounts
# - Insiders for testing; pin stable for daily
# ===== Pitfalls =====
# - Editing settings via the GUI and missing the JSON path -> harder to share
# - Installing every recommended extension on every machine -> startup time bloats
# - Mixing 'workspace' settings into .gitignore -> teammates get inconsistent setups
# - Settings Sync on a borrowed machine -> personal config leaks
Why it matters
A clean install + .vscode/{extensions,settings}.json + Settings Sync is most of the productivity dial. The user settings are personal; the workspace settings are team policy. Get that boundary right and a fresh laptop becomes productive in five minutes.
Tip: Tweak the snippet with Try it Yourself », then sit the quiz at the bottom of the page.
Example
Example
# Install — pick one # Windows: winget install Microsoft.VisualStudioCode # macOS: brew install --cask visual-studio-code # Linux: sudo snap install code --classic (or your distro package) # Verify code --versionTry it Yourself »
Discussion
Loading…