This reference collects the VS Code commands and shortcuts a data creator uses daily. Shortcuts are given for macOS; Linux and Windows shortcuts are identical except Cmd → Ctrl unless noted.
The code CLI
VS Code installs a code shim that controls the running editor from a terminal.
Setup
On macOS, run Shell Command: Install 'code' command in PATH from the command palette once. On Linux and Windows, the installer adds code to PATH by default.
Common invocations
code . # open the current directory
code file.py # open a single file
code file.py:42:5 # open file.py at line 42, column 5
code --new-window . # open in a new window
code --reuse-window file.py # reuse the current window
code --diff a.json b.json # open VS Code's diff viewer
code --wait commit_msg.txt # block until the editor is closed
Extension management
code --list-extensions # list installed extensions
code --install-extension <id> # install by ID
code --install-extension <id>@<ver> # install a pinned version
code --uninstall-extension <id> # remove
code --disable-extensions # launch with all extensions disabled (for debugging)
Other flags
code --goto <file>:<line>:<col> # open and jump to a location
code --add <path> # add a folder to the current workspace
code --version # print version and commit
code --verbose # verbose launch logs (for debugging)
code --user-data-dir <path> # use a separate user data dir (for isolated testing)
The command palette
Cmd+Shift+P opens the command palette. Every VS Code action is reachable from here; most engineers discover new features by typing the first word of what they want.
Useful prefixes in the palette:
>— the default, shows commands.:— go to line number (same asCmd+G).@— go to symbol in file (same asCmd+Shift+O).@:— go to symbol grouped by kind.#— go to symbol in workspace (same asCmd+T).?— show help.
Commands worth memorizing
| Command | Purpose |
|---|---|
| Python: Select Interpreter | Switch which Python is active |
| Python: Clear Cache and Reload Window | Fix "I reinstalled a package and Pylance didn't notice" |
| Format Document | Force-run the formatter |
| Organize Imports | Ruff reorder imports |
| Developer: Reload Window | Nuclear option; reload the window without restarting VS Code |
| Developer: Toggle Developer Tools | Open Chrome DevTools in the VS Code electron process |
| Dev Containers: Reopen in Container | Switch to the devcontainer |
| Dev Containers: Rebuild Container | Rebuild after changing devcontainer.json |
| Remote-SSH: Connect to Host | Open a folder on a remote SSH host |
| Databricks: Configure Workspace | Auth to a new Databricks workspace |
| dbt Power User: Generate Column Lineage | Open the lineage view |
| Git: Pull / Git: Push | Git operations without a terminal |
Navigation shortcuts
| Shortcut | Action |
|---|---|
Cmd+P | Quick open a file by name |
Cmd+Shift+P | Command palette |
Cmd+T | Go to symbol across the workspace |
Cmd+Shift+O | Go to symbol in the current file |
Cmd+G | Go to line |
F12 | Go to definition |
Option+F12 | Peek definition (inline) |
Cmd+F12 | Go to implementation |
Shift+F12 | Find all references |
Ctrl+- | Navigate back |
Ctrl+Shift+- | Navigate forward |
Cmd+Click | Ctrl+Click on Windows and Linux; same as F12 |
Cmd+Shift+F | Search across the workspace |
Cmd+Shift+H | Replace across the workspace |
Cmd+B | Toggle the side bar |
Cmd+J | Toggle the panel (terminal, problems, output) |
Editing shortcuts
| Shortcut | Action |
|---|---|
Cmd+D | Select the next occurrence of the current word (multi-cursor) |
Cmd+Shift+L | Select all occurrences of the current word |
Option+Click | Add another cursor |
Option+Up / Option+Down | Move the current line up/down |
Option+Shift+Up/Down | Copy the current line up/down |
Cmd+/ | Toggle line comment |
Option+Shift+F | Format the current document |
F2 | Rename symbol (LSP-aware) |
Cmd+. | Quick fix (show code actions) |
Cmd+K Cmd+C | Add line comment |
Cmd+K Cmd+U | Remove line comment |
Cmd+K Cmd+0 | Fold all |
Cmd+K Cmd+J | Unfold all |
Terminal shortcuts
| Shortcut | Action |
|---|---|
Ctrl+` | Toggle the integrated terminal |
Ctrl+Shift+` | New terminal |
Cmd+\ (in terminal) | Split the terminal |
Cmd+Shift+W (in terminal) | Close the current terminal |
Cmd+Option+Left/Right | Switch between terminals |
Debugger shortcuts
| Shortcut | Action |
|---|---|
F5 | Start or continue debugging |
F9 | Toggle breakpoint on the current line |
F10 | Step over |
F11 | Step into |
Shift+F11 | Step out |
Cmd+Shift+F5 | Restart debugging |
Shift+F5 | Stop debugging |
Cmd+K F5 | Run without debugging (fast start) |
Test Explorer shortcuts
| Shortcut | Action |
|---|---|
Cmd+; | Run all tests |
Cmd+; Cmd+F | Run tests in the current file |
Cmd+; Cmd+L | Run the last test |
Cmd+; Cmd+C | Cancel the current test run |
Cmd+; Cmd+A | Debug all tests |
Git shortcuts
| Shortcut | Action |
|---|---|
Ctrl+Shift+G | Open the Source Control panel |
Cmd+Enter (in the commit message box) | Commit |
| From the Source Control panel ••• menu | Pull, Push, Sync, Stash, Checkout |
| GitLens: Toggle File Blame | Show inline blame in the editor |
| GitLens: Open File on Remote | Open the current file on GitHub at the current revision |
Tasks
VS Code's Tasks run shell commands as first-class actions: they have names, keybindings, and output panels. Configure them in .vscode/tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "dbt: build modified+",
"type": "shell",
"command": "dbt build --select state:modified+ --defer --state target/",
"group": { "kind": "build", "isDefault": true },
"presentation": { "reveal": "always", "panel": "dedicated" }
},
{
"label": "astro: restart",
"type": "shell",
"command": "astro dev restart",
"presentation": { "reveal": "always" }
},
{
"label": "databricks: deploy dev",
"type": "shell",
"command": "databricks bundle deploy --target dev",
"presentation": { "reveal": "always" }
},
{
"label": "ruff: fix all",
"type": "shell",
"command": "ruff check --fix .",
"problemMatcher": "$ruff"
}
]
}
Run a task with Tasks: Run Task from the palette, or bind the default build task to Cmd+Shift+B:
// keybindings.json
{ "key": "cmd+shift+b", "command": "workbench.action.tasks.build" }
Bind any specific task to a shortcut:
{
"key": "cmd+alt+d",
"command": "workbench.action.tasks.runTask",
"args": "dbt: build modified+"
}
Tasks worth defining
For data-creator projects, the high-leverage tasks are:
dbt build --select state:modified+ --deferdbt test --select state:modified+dbt docs generate && dbt docs serveastro dev restartastro dev run dags test <dag_id>databricks bundle deploy --target devdatabricks bundle run <job_name> --target devruff check --fix .sqlfluff fix models/pre-commit run --all-files
Keybinding customization
Open Preferences: Open Keyboard Shortcuts (Cmd+K Cmd+S) to browse and rebind. The UI writes to keybindings.json in your user config. Keybindings can be conditional via the when clause — the shortcut only activates in the stated context:
[
{
"key": "cmd+r cmd+d",
"command": "databricks.runFileAsWorkflow",
"when": "resourceExtname == .py"
}
]
Settings reveals
Skip the UI and edit JSON directly with:
Preferences: Open User Settings (JSON)— user config, synced via Settings Sync.Preferences: Open Workspace Settings (JSON)—.vscode/settings.json, committed to the repo.Preferences: Open Remote Settings (JSON)— settings scoped to the current remote/devcontainer.
Productivity patterns
- Never leave home row. Every mouse trip costs a quarter-second of focus. The shortcuts above cover 95% of daily actions.
- Palette-first discovery. When you do not know the shortcut, open the palette and search by name. The palette shows the bound shortcut so you learn it.
- Tasks for recurrences. If you run the same command three times a day, make it a Task.
- Keep user and workspace settings separate. User = personal. Workspace = team-shared.
See also
- Settings reference — full
settings.json,launch.json, andtasks.jsonrecipes. - Debugging — the launch configs the debugger shortcuts apply to.
- Inner loop — the per-stack cadences these shortcuts support.