iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

Settings

VS Code settings: user vs workspace, JSON vs UI, scoped overrides, and the choices that make every project feel like home.

VS Code — settings

EXAMPLE
# ===== Where settings live =====
# User settings (global)
#   macOS:   ~/Library/Application Support/Code/User/settings.json
#   Linux:   ~/.config/Code/User/settings.json
#   Windows: %APPDATA%\Code\User\settings.json
# Workspace settings
#   <project>/.vscode/settings.json   (committed -> team-wide)
# Folder settings (multi-root workspaces)

# Workspace overrides user. Folder overrides workspace.

# ===== Editing =====
# Command Palette -> 'Preferences: Open User Settings (JSON)'
# Or 'Preferences: Open Workspace Settings (JSON)'

# ===== A solid user starter =====
{
  // Editor
  "editor.fontFamily": "JetBrains Mono, Menlo, Consolas, monospace",
  "editor.fontSize": 13,
  "editor.fontLigatures": true,
  "editor.tabSize": 2,
  "editor.detectIndentation": true,
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll": "explicit",
    "source.organizeImports": "explicit"
  },
  "editor.cursorBlinking": "phase",
  "editor.minimap.enabled": false,
  "editor.inlineSuggest.enabled": true,
  "editor.suggest.preview": true,
  "editor.linkedEditing": true,
  "editor.bracketPairColorization.enabled": true,
  "editor.guides.bracketPairs": "active",

  // Files
  "files.trimTrailingWhitespace": true,
  "files.insertFinalNewline": true,
  "files.eol": "\n",
  "files.exclude": { "**/.git": true, "**/node_modules": true },

  // Workbench
  "workbench.startupEditor": "none",
  "workbench.colorTheme": "Default Dark Modern",
  "workbench.iconTheme": "vs-seti",

  // Explorer
  "explorer.confirmDragAndDrop": false,
  "explorer.compactFolders": false,

  // Terminal
  "terminal.integrated.defaultProfile.osx": "zsh",
  "terminal.integrated.fontSize": 12,

  // Per-language overrides
  "[typescript][typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[python]": {
    "editor.defaultFormatter": "ms-python.black-formatter"
  },
  "[go]": {
    "editor.defaultFormatter": "golang.go",
    "editor.tabSize": 4,
    "editor.insertSpaces": false
  }
}

# ===== A workspace starter (per-project, committed) =====
# .vscode/settings.json
{
  "editor.formatOnSave": true,
  "typescript.tsdk": "node_modules/typescript/lib",
  "typescript.preferences.importModuleSpecifier": "non-relative",
  "eslint.workingDirectories": [{ "mode": "auto" }],
  "eslint.validate": ["javascript", "typescript", "typescriptreact"],
  "files.associations": {
    "*.env.example": "dotenv"
  }
}

# Commit alongside .vscode/extensions.json (recommendations) so teammates inherit them.

# ===== Settings precedence =====
# 1. Folder settings (multi-root)
# 2. Workspace settings (.vscode/settings.json)
# 3. User settings
# 4. Default settings

# ===== Settings Sync (across machines) =====
# Account icon -> Turn on Settings Sync
# Choose: Settings, Keybindings, Extensions, Snippets, UI State

# ===== Useful command palette entries =====
# 'Preferences: Open User Settings'           UI
# 'Preferences: Open User Settings (JSON)'    JSON
# 'Preferences: Open Workspace Settings (JSON)'
# 'Preferences: Configure Language Specific Settings'

# ===== Patterns to internalise =====
# - Commit workspace settings; do not rely on user settings for team consistency
# - Use per-language overrides for formatters + tab size
# - Settings Sync across personal machines only
# - Trust workspace JSON, not the UI (UI hides options)

# ===== Pitfalls =====
# - User settings overriding workspace expectations (formatOnSave forced off)
# - Wrong defaultFormatter chosen by extension order
# - Settings Sync on a borrowed machine -> personal config leaks
# - Editing settings while a workspace is open and surprised when global takes effect

Why it matters

Settings are layered: user, workspace, folder. Commit workspace settings to keep teammates aligned, use per-language overrides for formatters, and let Settings Sync ship your personal preferences across machines. Most "VS Code is weird on this project" stories are uncommitted workspace settings.

Tip: Tweak the snippet with Try it Yourself », then sit the quiz at the bottom of the page.

Example

Example
// Open settings:   Ctrl/Cmd + ,
// Settings live in settings.json (per-user) and .vscode/settings.json (per-workspace).
{
    "editor.fontSize": 14,
    "editor.formatOnSave": true,
    "files.eol": "\n"
}
Try it Yourself »

Discussion

Loading…