# VS Code Quick Reference

*Navigation, editing, multi-cursor, terminal, debugging, extensions*

> Source: VS Code Documentation (code.visualstudio.com/docs) · MIT

## Navigation

### File & Symbol Navigation

| Command | Description |
|---------|-------------|
| `Ctrl+P` | Quick Open file by name |
| `Ctrl+Shift+P` | Command Palette |
| `Ctrl+Shift+O` | Go to symbol in file |
| `Ctrl+T` | Go to symbol in workspace |
| `Ctrl+G` | Go to line number |
| `F12` | Go to definition |
| `Alt+F12` | Peek definition |
| `Shift+F12` | Find all references |
| `Ctrl+Shift+\` | Jump to matching bracket |

### Tab & Editor Navigation

| Command | Description |
|---------|-------------|
| `Ctrl+Tab` | Cycle through open tabs |
| `Ctrl+1 / 2 / 3` | Focus editor group 1 / 2 / 3 |
| `Ctrl+\` | Split editor |
| `Ctrl+B` | Toggle sidebar |
| `Ctrl+J` | Toggle bottom panel |

## Editing

### Line Operations

| Command | Description |
|---------|-------------|
| `Ctrl+Shift+K` | Delete entire line |
| `Alt+Up / Down` | Move line up / down |
| `Shift+Alt+Up / Down` | Copy line up / down |
| `Ctrl+Enter` | Insert line below |
| `Ctrl+Shift+Enter` | Insert line above |
| `Ctrl+Shift+[` | Fold region |
| `Ctrl+Shift+]` | Unfold region |

### Text Manipulation

| Command | Description |
|---------|-------------|
| `Ctrl+D` | Select word (repeat to add next match) |
| `Ctrl+Shift+L` | Select all occurrences of selection |
| `Ctrl+L` | Select entire line |
| `Ctrl+/` | Toggle line comment |
| `Shift+Alt+A` | Toggle block comment |
| `Tab / Shift+Tab` | Indent / outdent line |

## Multi-Cursor

### Adding Cursors

| Command | Description |
|---------|-------------|
| `Alt+Click` | Add cursor at click position |
| `Ctrl+Alt+Up / Down` | Add cursor above / below |
| `Ctrl+D` | Add next occurrence of selection |
| `Ctrl+Shift+L` | Add cursor at all occurrences |
| `Ctrl+U` | Undo last cursor addition |
| `Esc` | Exit multi-cursor mode |

### Multi-Cursor Workflow

```
// Select a word, then Ctrl+D to add matches
// Type replacement — all cursors update
// Ctrl+Shift+L selects ALL matches at once
// Alt+Click for arbitrary cursor placement
```

## Terminal

### Terminal Shortcuts

| Command | Description |
|---------|-------------|
| `Ctrl+`` | Toggle integrated terminal |
| `Ctrl+Shift+`` | Create new terminal |
| `Ctrl+Shift+5` | Split terminal |
| `Ctrl+PgUp / PgDn` | Scroll terminal up / down |
| `Ctrl+Shift+C` | Copy selection in terminal |
| `Ctrl+Shift+V` | Paste into terminal |

### Terminal Management

| Command | Description |
|---------|-------------|
| `Ctrl+Shift+P → Terminal: Kill` | Kill active terminal |
| `Ctrl+Shift+P → Terminal: Rename` | Rename terminal tab |
| `Terminal dropdown` | Switch between terminals |
| `terminal.integrated.shell.*` | Setting to change default shell |

## Debugging

### Debug Controls

| Command | Description |
|---------|-------------|
| `F5` | Start / continue debugging |
| `Shift+F5` | Stop debugging |
| `Ctrl+Shift+F5` | Restart debugging |
| `F9` | Toggle breakpoint |
| `F10` | Step over |
| `F11` | Step into |
| `Shift+F11` | Step out |

### launch.json Example

```
{
  "type": "node",
  "request": "launch",
  "name": "Run App",
  "program": "${workspaceFolder}/app.js"
}
```

### Debug Features

| Command | Description |
|---------|-------------|
| `Watch panel` | Monitor expressions during debugging |
| `Call Stack` | View execution call stack |
| `Debug Console` | Evaluate expressions at breakpoint |
| `Conditional breakpoint` | Right-click breakpoint → Edit condition |
| `Logpoint` | Log message without stopping execution |

## Extensions

### Extension Management

| Command | Description |
|---------|-------------|
| `Ctrl+Shift+X` | Open Extensions view |
| `@installed` | Filter to show installed extensions |
| `@enabled / @disabled` | Filter by enabled / disabled |
| `@recommended` | Show recommended extensions |

### Essential Extensions

| Command | Description |
|---------|-------------|
| `Prettier` | Code formatter (JS, TS, CSS, HTML) |
| `ESLint` | JavaScript/TypeScript linting |
| `GitLens` | Enhanced Git integration and blame |
| `Remote - SSH` | Develop on remote machines via SSH |
| `Live Server` | Local dev server with live reload |
| `Thunder Client` | REST API client inside VS Code |

## Settings

### Accessing Settings

| Command | Description |
|---------|-------------|
| `Ctrl+,` | Open Settings UI |
| `Ctrl+Shift+P → settings.json` | Open settings JSON |

### Common Settings (JSON)

```
{
  "editor.fontSize": 14,
  "editor.tabSize": 2,
  "editor.formatOnSave": true,
  "editor.wordWrap": "on",
  "files.autoSave": "afterDelay"
}
```

### Workspace vs User

| Command | Description |
|---------|-------------|
| `User settings` | Global, apply to all projects |
| `Workspace settings` | Per-project, in .vscode/settings.json |
| `Workspace overrides User` | Workspace settings take priority |

## Keyboard Shortcuts

### Customization

| Command | Description |
|---------|-------------|
| `Ctrl+K Ctrl+S` | Open Keyboard Shortcuts editor |
| `keybindings.json` | JSON file for custom bindings |

### Essential Shortcuts

| Command | Description |
|---------|-------------|
| `Ctrl+Shift+P` | Command Palette (access everything) |
| `Ctrl+P` | Quick Open file |
| `Ctrl+Shift+F` | Search across all files |
| `Ctrl+H` | Find and replace in file |
| `Ctrl+Shift+H` | Find and replace across files |
| `F2` | Rename symbol |
| `Ctrl+.` | Quick Fix (code actions) |
| `Ctrl+Space` | Trigger IntelliSense |
| `Ctrl+Shift+I` | Format document |

## Git Integration

### Source Control View

| Command | Description |
|---------|-------------|
| `Ctrl+Shift+G` | Open Source Control panel |
| `+` | Stage changes (in SCM view) |
| `-` | Unstage changes |
| `Ctrl+Enter` | Commit staged changes |
| `...` | More actions (push, pull, etc.) |

### Inline Git Features

| Command | Description |
|---------|-------------|
| `Gutter indicators` | Green/blue/red marks for added/modified/deleted |
| `Ctrl+Shift+P → Git: Checkout` | Switch branches |
| `Ctrl+Shift+P → Git: Pull` | Pull from remote |
| `Ctrl+Shift+P → Git: Push` | Push to remote |
| `Click gutter change` | Inline diff view for modified lines |

### Diff & Merge

| Command | Description |
|---------|-------------|
| `SCM → Open Changes` | Side-by-side diff view |
| `Inline diff arrows` | Revert individual changes |
| `3-way merge editor` | Resolve conflicts visually (1.69+) |

## Common Patterns

### Workspace Features

| Command | Description |
|---------|-------------|
| `Ctrl+Shift+E` | Focus file explorer |
| `Ctrl+Shift+D` | Focus debug view |
| `Ctrl+Shift+M` | Show problems panel |
| `Ctrl+K Ctrl+T` | Change color theme |
| `Ctrl+K Z` | Enter Zen mode |

### Snippets

```
// File → Preferences → Configure Snippets
"Print": {
  "prefix": "log",
  "body": "console.log('$1');",
  "description": "Console log"
}
```

### Tasks (tasks.json)

```
{
  "label": "build",
  "type": "shell",
  "command": "npm run build",
  "group": "build"
}
```
