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 CmdCtrl 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:

Commands worth memorizing

CommandPurpose
Python: Select InterpreterSwitch which Python is active
Python: Clear Cache and Reload WindowFix "I reinstalled a package and Pylance didn't notice"
Format DocumentForce-run the formatter
Organize ImportsRuff reorder imports
Developer: Reload WindowNuclear option; reload the window without restarting VS Code
Developer: Toggle Developer ToolsOpen Chrome DevTools in the VS Code electron process
Dev Containers: Reopen in ContainerSwitch to the devcontainer
Dev Containers: Rebuild ContainerRebuild after changing devcontainer.json
Remote-SSH: Connect to HostOpen a folder on a remote SSH host
Databricks: Configure WorkspaceAuth to a new Databricks workspace
dbt Power User: Generate Column LineageOpen the lineage view
Git: Pull / Git: PushGit operations without a terminal

Navigation shortcuts

ShortcutAction
Cmd+PQuick open a file by name
Cmd+Shift+PCommand palette
Cmd+TGo to symbol across the workspace
Cmd+Shift+OGo to symbol in the current file
Cmd+GGo to line
F12Go to definition
Option+F12Peek definition (inline)
Cmd+F12Go to implementation
Shift+F12Find all references
Ctrl+-Navigate back
Ctrl+Shift+-Navigate forward
Cmd+ClickCtrl+Click on Windows and Linux; same as F12
Cmd+Shift+FSearch across the workspace
Cmd+Shift+HReplace across the workspace
Cmd+BToggle the side bar
Cmd+JToggle the panel (terminal, problems, output)

Editing shortcuts

ShortcutAction
Cmd+DSelect the next occurrence of the current word (multi-cursor)
Cmd+Shift+LSelect all occurrences of the current word
Option+ClickAdd another cursor
Option+Up / Option+DownMove the current line up/down
Option+Shift+Up/DownCopy the current line up/down
Cmd+/Toggle line comment
Option+Shift+FFormat the current document
F2Rename symbol (LSP-aware)
Cmd+.Quick fix (show code actions)
Cmd+K Cmd+CAdd line comment
Cmd+K Cmd+URemove line comment
Cmd+K Cmd+0Fold all
Cmd+K Cmd+JUnfold all

Terminal shortcuts

ShortcutAction
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/RightSwitch between terminals

Debugger shortcuts

ShortcutAction
F5Start or continue debugging
F9Toggle breakpoint on the current line
F10Step over
F11Step into
Shift+F11Step out
Cmd+Shift+F5Restart debugging
Shift+F5Stop debugging
Cmd+K F5Run without debugging (fast start)

Test Explorer shortcuts

ShortcutAction
Cmd+;Run all tests
Cmd+; Cmd+FRun tests in the current file
Cmd+; Cmd+LRun the last test
Cmd+; Cmd+CCancel the current test run
Cmd+; Cmd+ADebug all tests

Git shortcuts

ShortcutAction
Ctrl+Shift+GOpen the Source Control panel
Cmd+Enter (in the commit message box)Commit
From the Source Control panel ••• menuPull, Push, Sync, Stash, Checkout
GitLens: Toggle File BlameShow inline blame in the editor
GitLens: Open File on RemoteOpen 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:

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:

Productivity patterns

See also