---
name: vscode
description: "Provides Visual Studio Code keyboard shortcuts and commands for efficient code editing. Use when looking up VS Code keybindings, explaining editor shortcuts, or configuring keybindings.json."
---

## Complete Keyboard Shortcuts

### Basic Editing

| Command                           | macOS     | Windows/Linux    |
| --------------------------------- | --------- | ---------------- |
| Cut line (empty selection)        | ⌘X        | Ctrl+X           |
| Copy line (empty selection)       | ⌘C        | Ctrl+C           |
| Paste                             | ⌘V        | Ctrl+V           |
| Delete Line                       | ⇧⌘K       | Ctrl+Shift+K     |
| Insert Line Below                 | ⌘Enter    | Ctrl+Enter       |
| Insert Line Above                 | ⇧⌘Enter   | Ctrl+Shift+Enter |
| Move Line Down                    | ⌥↓        | Alt+Down         |
| Move Line Up                      | ⌥↑        | Alt+Up           |
| Copy Line Down                    | ⇧⌥↓       | Shift+Alt+Down   |
| Copy Line Up                      | ⇧⌥↑       | Shift+Alt+Up     |
| Undo                              | ⌘Z        | Ctrl+Z           |
| Redo                              | ⇧⌘Z       | Ctrl+Y           |
| Add Selection To Next             | ⌘D        | Ctrl+D           |
| Move Last Selection To Next       | ⌘K ⌘D     | Ctrl+K Ctrl+D    |
| Undo last cursor operation        | ⌘U        | Ctrl+U           |
| Insert cursor at end of each line | ⇧⌥I       | Shift+Alt+I      |
| Select all occurrences            | ⇧⌘L       | Ctrl+Shift+L     |
| Select all occurrences of word    | ⌘F2       | Ctrl+F2          |
| Select current line               | ⌘L        | Ctrl+L           |
| Insert Cursor Below               | ⌥⌘↓       | Ctrl+Alt+Down    |
| Insert Cursor Above               | ⌥⌘↑       | Ctrl+Alt+Up      |
| Jump to matching bracket          | ⇧⌘\       | Ctrl+Shift+\     |
| Indent Line                       | ⌘]        | Ctrl+]           |
| Outdent Line                      | ⌘[        | Ctrl+[           |
| Go to Beginning of Line           | Home      | Home             |
| Go to End of Line                 | End       | End              |
| Go to End of File                 | ⌘↓        | Ctrl+End         |
| Go to Beginning of File           | ⌘↑        | Ctrl+Home        |
| Scroll Line Down                  | ⌃PageDown | Ctrl+Down        |
| Scroll Line Up                    | ⌃PageUp   | Ctrl+Up          |
| Scroll Page Down                  | ⌘PageDown | Alt+PageDown     |
| Scroll Page Up                    | ⌘PageUp   | Alt+PageUp       |

### Word-Level Navigation

| Command                 | macOS   | Windows/Linux     |
| ----------------------- | ------- | ----------------- |
| Move to previous word   | ⌥←      | Alt+Left          |
| Move to next word       | ⌥→      | Alt+Right         |
| Select to previous word | ⌥⇧←     | Shift+Alt+Left    |
| Select to next word     | ⌥⇧→     | Shift+Alt+Right   |
| Delete previous word    | ⌥⌫      | Ctrl+W            |
| Delete next word        | ⌥Delete | Ctrl+Shift+Delete |

### Folding

| Command                    | macOS | Windows/Linux |
| -------------------------- | ----- | ------------- |
| Fold (collapse) region     | ⌥⌘[   | Ctrl+Shift+[  |
| Unfold (uncollapse) region | ⌥⌘]   | Ctrl+Shift+]  |
| Toggle Fold region         | ⌘K ⌘L | Ctrl+K Ctrl+L |
| Fold all subregions        | ⌘K ⌘[ | Ctrl+K Ctrl+[ |
| Unfold all subregions      | ⌘K ⌘] | Ctrl+K Ctrl+] |
| Fold all regions           | ⌘K ⌘0 | Ctrl+K Ctrl+0 |
| Unfold all regions         | ⌘K ⌘J | Ctrl+K Ctrl+J |

### Comments

| Command              | macOS | Windows/Linux |
| -------------------- | ----- | ------------- |
| Add Line Comment     | ⌘K ⌘C | Ctrl+K Ctrl+C |
| Remove Line Comment  | ⌘K ⌘U | Ctrl+K Ctrl+U |
| Toggle Line Comment  | ⌘/    | Ctrl+/        |
| Toggle Block Comment | ⇧⌥A   | Shift+Alt+A   |

### Find/Replace

| Command                    | macOS  | Windows/Linux |
| -------------------------- | ------ | ------------- |
| Find                       | ⌘F     | Ctrl+F        |
| Replace                    | ⌥⌘F    | Ctrl+H        |
| Find Next                  | Enter  | Enter         |
| Find Previous              | ⇧Enter | Shift+Enter   |
| Select All Find Matches    | ⌥Enter | Alt+Enter     |
| Toggle Find Case Sensitive | ⌥⌘C    | Alt+C         |
| Toggle Find Regex          | ⌥⌘R    | Alt+R         |
| Toggle Find Whole Word     | ⌥⌘W    | Alt+W         |
| Toggle Word Wrap           | ⌥Z     | Alt+Z         |

### Rich Languages Editing

| Command                     | macOS   | Windows/Linux    |
| --------------------------- | ------- | ---------------- |
| Trigger Suggest             | ⌃Space  | Ctrl+Space       |
| Trigger Parameter Hints     | ⇧⌘Space | Ctrl+Shift+Space |
| Format Document             | ⇧⌥F     | Shift+Alt+F      |
| Format Selection            | ⌘K ⌘F   | Ctrl+K Ctrl+F    |
| Go to Definition            | F12     | F12              |
| Show Hover                  | ⌘K ⌘I   | Ctrl+K Ctrl+I    |
| Peek Definition             | ⌥F12    | Alt+F12          |
| Open Definition to the Side | ⌘K F12  | Ctrl+K F12       |
| Quick Fix                   | ⌘.      | Ctrl+.           |
| Go to References            | ⇧F12    | Shift+F12        |
| Rename Symbol               | F2      | F2               |
| Replace with Next Value     | ⇧⌘.     | Ctrl+Shift+.     |
| Replace with Previous Value | ⇧⌘,     | Ctrl+Shift+,     |
| Expand AST Selection        | ⌃⇧⌘→    | Shift+Alt+Right  |
| Shrink AST Selection        | ⌃⇧⌘←    | Shift+Alt+Left   |
| Trim Trailing Whitespace    | ⌘K ⌘X   | Ctrl+K Ctrl+X    |
| Change Language Mode        | ⌘K M    | Ctrl+K M         |

### Navigation

| Command                       | macOS     | Windows/Linux      |
| ----------------------------- | --------- | ------------------ |
| Show All Symbols              | ⌘T        | Ctrl+T             |
| Go to Line...                 | ⌃G        | Ctrl+G             |
| Go to File/Quick Open         | ⌘P        | Ctrl+P             |
| Go to Symbol...               | ⇧⌘O       | Ctrl+Shift+O       |
| Show Problems                 | ⇧⌘M       | Ctrl+Shift+M       |
| Go to Next Error              | F8        | F8                 |
| Go to Previous Error          | ⇧F8       | Shift+F8           |
| Show All Commands             | ⇧⌘P or F1 | Ctrl+Shift+P or F1 |
| Navigate Editor Group History | ⌃Tab      | Ctrl+Tab           |
| Go Back                       | ⌃-        | Alt+Left           |
| Go Forward                    | ⌃⇧-       | Alt+Right          |
| Focus Breadcrumbs             | ⇧⌘;       | Ctrl+Shift+;       |
| Focus and Select Breadcrumbs  | ⇧⌘.       | Ctrl+Shift+.       |

### Editor/Window Management

| Command                       | macOS  | Windows/Linux       |
| ----------------------------- | ------ | ------------------- |
| New Window                    | ⇧⌘N    | Ctrl+Shift+N        |
| Close Window                  | ⇧⌘W    | Alt+F4              |
| Close Editor                  | ⌘W     | Ctrl+W / Ctrl+F4    |
| Close Folder                  | ⌘K F   | Ctrl+K F            |
| Split Editor                  | ⌘\     | Ctrl+\              |
| Focus First Editor Group      | ⌘1     | Ctrl+1              |
| Focus Second Editor Group     | ⌘2     | Ctrl+2              |
| Focus Third Editor Group      | ⌘3     | Ctrl+3              |
| Focus Editor Group Left       | ⌘K ⌘←  | Ctrl+K Ctrl+Left    |
| Focus Editor Group Right      | ⌘K ⌘→  | Ctrl+K Ctrl+Right   |
| Move Editor Left              | ⌘K ⇧⌘← | Ctrl+Shift+PageUp   |
| Move Editor Right             | ⌘K ⇧⌘→ | Ctrl+Shift+PageDown |
| Move Editor Group Left        | ⌘K ←   | Ctrl+K Left         |
| Move Editor Group Right       | ⌘K →   | Ctrl+K Right        |
| Move Editor to Next Group     | ⌃⌘→    | Ctrl+Alt+Right      |
| Move Editor to Previous Group | ⌃⌘←    | Ctrl+Alt+Left       |

### File Management

| Command                  | macOS    | Windows/Linux    |
| ------------------------ | -------- | ---------------- |
| New File                 | ⌘N       | Ctrl+N           |
| Open File...             | ⌘O       | Ctrl+O           |
| Save                     | ⌘S       | Ctrl+S           |
| Save All                 | ⌥⌘S      | Ctrl+K S         |
| Save As...               | ⇧⌘S      | Ctrl+Shift+S     |
| Close                    | ⌘W       | Ctrl+W / Ctrl+F4 |
| Close Group              | ⌘K W     | Ctrl+K W         |
| Close All                | ⌘K ⌘W    | Ctrl+K Ctrl+W    |
| Reopen Closed Editor     | ⇧⌘T      | Ctrl+Shift+T     |
| Keep Open                | ⌘K Enter | Ctrl+K Enter     |
| Copy Path of Active File | ⌘K P     | Ctrl+K P         |
| Reveal Active File       | ⌘K R     | Ctrl+K R         |

### Display

| Command                    | macOS         | Windows/Linux |
| -------------------------- | ------------- | ------------- |
| Toggle Full Screen         | ⌃⌘F           | F11           |
| Toggle Zen Mode            | ⌘K Z          | Ctrl+K Z      |
| Leave Zen Mode             | Escape Escape | Escape Escape |
| Zoom in                    | ⌘=            | Ctrl+=        |
| Zoom out                   | ⌘-            | Ctrl+-        |
| Reset Zoom                 | ⌘Numpad0      | Ctrl+Numpad0  |
| Toggle Sidebar             | ⌘B            | Ctrl+B        |
| Show Explorer              | ⇧⌘E           | Ctrl+Shift+E  |
| Show Search                | ⇧⌘F           | Ctrl+Shift+F  |
| Show Source Control        | ⌃⇧G           | Ctrl+Shift+G  |
| Show Run/Debug             | ⇧⌘D           | Ctrl+Shift+D  |
| Show Extensions            | ⇧⌘X           | Ctrl+Shift+X  |
| Show Output                | ⇧⌘U           | Ctrl+Shift+U  |
| Toggle Integrated Terminal | ⌃`            | Ctrl+`        |

### Search (Files)

| Command                 | macOS | Windows/Linux |
| ----------------------- | ----- | ------------- |
| Show Search             | ⇧⌘F   | Ctrl+Shift+F  |
| Replace in Files        | ⇧⌘H   | Ctrl+Shift+H  |
| Toggle Match Case       | ⌥⌘C   | Alt+C         |
| Toggle Match Whole Word | ⌥⌘W   | Alt+W         |
| Toggle Regex            | ⌥⌘R   | Alt+R         |
| Toggle Search Details   | ⇧⌘J   | Ctrl+Shift+J  |
| Focus Next Result       | F4    | F4            |
| Focus Previous Result   | ⇧F4   | Shift+F4      |

### Preferences

| Command                 | macOS | Windows/Linux |
| ----------------------- | ----- | ------------- |
| Open Settings           | ⌘,    | Ctrl+,        |
| Open Keyboard Shortcuts | ⌘K ⌘S | Ctrl+K Ctrl+S |
| Select Color Theme      | ⌘K ⌘T | Ctrl+K Ctrl+T |

### Chat (AI)

| Command                    | macOS | Windows/Linux    |
| -------------------------- | ----- | ---------------- |
| Open Chat view             | ⌃⌘I   | Ctrl+Alt+I       |
| Open chat in agent mode    | ⇧⌘I   | Ctrl+Shift+I     |
| Open editor inline chat    | ⌘I    | Ctrl+I           |
| Open terminal inline chat  | ⌘I    | Ctrl+I           |
| Open quick chat            | ⇧⌥⌘L  | Ctrl+Shift+Alt+L |
| Open agent picker          | ⌘.    | Ctrl+.           |
| Open language model picker | ⌥⌘.   | Ctrl+Alt+.       |
| New chat session           | ⌘N    | Ctrl+N           |
| Accept inline suggestion   | Tab   | Tab              |

### Debug

| Command                   | macOS | Windows/Linux |
| ------------------------- | ----- | ------------- |
| Toggle Breakpoint         | F9    | F9            |
| Start/Continue            | F5    | F5            |
| Start (without debugging) | ⌃F5   | Ctrl+F5       |
| Pause                     | F6    | F6            |
| Step Into                 | F11   | F11           |
| Step Over                 | F10   | F10           |
| Step Out                  | ⇧F11  | Shift+F11     |
| Stop                      | ⇧F5   | Shift+F5      |

### Transform Case (Command Palette)

| Command                 | Command ID                            |
| ----------------------- | ------------------------------------- |
| Transform to Uppercase  | `editor.action.transformToUppercase`  |
| Transform to Lowercase  | `editor.action.transformToLowercase`  |
| Transform to Title Case | `editor.action.transformToTitleCase`  |
| Transform to camelCase  | `editor.action.transformToCamelCase`  |
| Transform to PascalCase | `editor.action.transformToPascalCase` |
| Transform to snake_case | `editor.action.transformToSnakeCase`  |
| Transform to kebab-case | `editor.action.transformToKebabCase`  |

**Key symbols:** ⌘=Command, ⌥=Option, ⇧=Shift, ⌃=Control

## Configuration

### Open Keybindings

- **UI**: `Ctrl/Cmd + K, Ctrl/Cmd + S`
- **JSON**: Command Palette → "Open Keyboard Shortcuts (JSON)"

### Add Custom Shortcut

```json
{
  "key": "ctrl+shift+u",
  "command": "editor.action.transformToUppercase",
  "when": "editorTextFocus"
}
```

### Common Custom Shortcuts

```json
[
  {
    "key": "ctrl+shift+u",
    "command": "editor.action.transformToUppercase",
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+shift+l",
    "command": "editor.action.transformToLowercase",
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+shift+t",
    "command": "editor.action.transformToTitleCase",
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+w",
    "command": "editor.action.deleteWordLeft",
    "when": "editorTextFocus"
  }
]
```
