---
title: "VS Code"
lang: "en"
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/vscode
---

[Home](/)›[Cheatsheets](/cheatsheets)

Cheatsheets

# VS Code

Complete VS Code keyboard shortcuts reference including command palette, navigation, editing, debugging, multicursor operations, and advanced features for macOS and Windows/Linux

9 Categories16 Sections32 ExamplesPublished: 01 Jan 2024Updated: 28 Feb 2026

VS CodeVisual Studio CodeKeyboard ShortcutsEditorDevelopmentProductivity

[Markdown for AI(opens in a new tab)](/vscode/index.md "Open the plain-Markdown version of this page, for pasting into an AI tool")

Series

[Developer Environment & Tooling](/series/developer-environment--tooling)5/6

[PreviousVim](/cheatsheets/vim)[NextPython Virtual Environments Cheatsheet](/cheatsheets/python-venv)

All posts in this series (6)

Cheatsheets6

1.  [Git](/cheatsheets/git)
2.  [Screen](/cheatsheets/screen)
3.  [Tmux](/cheatsheets/tmux)
4.  [Vim](/cheatsheets/vim)
5.  [VS CodeYou are here](/cheatsheets/vscode)
6.  [Python Virtual Environments Cheatsheet](/cheatsheets/python-venv)

A quick reference for Visual Studio Code: keyboard shortcuts, editor features, and working habits for editing and navigation.

[Command Palette & Navigation](#category-command-palette-navigation)

-   [Command Palette](#section-command-palette)
-   [Go To Line and Symbol](#section-go-to-line)

[Sidebars & Views](#category-sidebars-views)

-   [Toggle Sidebars and Panels](#section-toggle-sidebars)
-   [Bottom Panel and Terminal](#section-bottom-panel)

[Editor Management](#category-editor-management)

-   [Split Editors](#section-split-editors)
-   [Zen Mode](#section-zen-mode)

[Text Editing](#category-text-editing)

-   [Line Operations](#section-line-operations)
-   [Selection and Navigation](#section-selection-navigation)

[Find & Replace](#category-find-replace)

-   [Find and Replace](#section-find-replace-basic)
-   [Find in Files and Workspace](#section-find-in-files)

[Debugging](#category-debugging)

-   [Debug Control and Breakpoints](#section-debug-control)
-   [Debug Stepping](#section-debug-stepping)

[Multi-Cursor & Selection](#category-multi-cursor-selection)

-   [Multi-Cursor Editing](#section-multi-cursor-operations)

[Advanced Features](#category-advanced-features)

-   [Go to Definition and References](#section-goto-definition)
-   [Code Actions and Quick Fixes](#section-code-actions)

[Extension Management](#category-extension-management)

-   [Installing and Managing Extensions](#section-extension-operations)

No commands found

Try adjusting your search term

## Command Palette & Navigation

Quick access to commands, files, and navigation features

### Command Palette

Access all VS Code commands with keyboard shortcuts

#### Accessibility

Clear access to all VS Code commands and features

#### Best Practices

-   Use command palette for infrequently used features
-   Assign custom shortcuts for commands you use daily
-   Remember common shortcuts to reduce reliance on palette
-   Use ⌘P for file switching in large projects

#### Common Errors

-   **Cannot find command:** Check spelling or use partial name; command may require extension

#### Keywords

commandpalettequickopenfilter

[Learn more](https://code.visualstudio.com/docs/getstarted/userinterface)

#### Open command palette

The command palette provides instant access to every VS Code command. Filter by typing the command name and press Enter to execute.

Code

```
1// Command Palette - access all VS Code commands2// macOS: ⇧⌘P3// Windows/Linux: Ctrl+Shift+P4
5// Once open, you can:6// - Type to filter commands7// - Use arrow keys to navigate8// - Press Enter to execute command9// - Press Escape to close10
11// Common command palette searches:12// "format document" - format entire file13// "sort lines" - sort selected lines alphabetically14// "duplicate line" - duplicate current line15// "go to line" - jump to specific line number
```

-   Reaches every VS Code command, including ones with no menu entry
-   Faster than menu navigation for most tasks
-   Shows keyboard shortcuts for commands you use frequently
-   Can customize and assign commands to keyboard shortcuts

#### Quick file switcher

Quickly switch between open files by searching filename. Faster than clicking tabs for projects with many open files.

Code

```
1// Quick File Switcher - jump between open files2// macOS: ⌘P3// Windows/Linux: Ctrl+P4
5// Once open:6// - Type filename to filter7// - Press Enter to open file8// - Use arrow keys to navigate results9// - Press Escape to close without opening10
11// Tips:12// - Type partial filename: "app" finds "App.tsx", "app.config.ts"13// - Type path separators: "src/components" finds components in src14// - Press right arrow to open in split editor
```

-   Shows recently opened files first
-   Highlights matching characters in filename
-   Works with dirty (unsaved) files
-   Useful for multi-file editing workflows

### Go To Line and Symbol

Navigate to specific lines and code symbols

#### Accessibility

Quick navigation to specific code locations

#### Best Practices

-   Use Ctrl+G for error line navigation
-   Use Ctrl+Shift+O to understand file structure
-   Combine symbol navigation with breadcrumbs

#### Common Errors

-   **No symbols found:** Language may not have symbol support; use Ctrl+G for line number instead

#### Keywords

gotolinesymboljumpnavigate

[Learn more](https://code.visualstudio.com/docs/editor/codebasics)

#### Go to line number

Go to line command instantly jumps to any line number in the current file, useful for navigating large files based on error messages.

Code

```
1// Go To Line - jump to specific line number2// macOS: ^G  (Control+G)3// Windows/Linux: Ctrl+G4
5// Usage:6// 1. Press Ctrl+G (or ^G on Mac)7// 2. Type line number8// 3. Press Enter to jump9// 4. Also shows column number support: "10:5" goes to line 10, column 510
11// Example file with decorators (line 25):12// function processData() {13//   const result = transform(data);     // Line 2514//   return result;15// }
```

-   Useful when an error message references a line number
-   Can include column number: 'line:column'
-   Faster than scrolling or searching
-   Works in any file type

#### Go to symbol in file

Navigate to any function, class, or variable definition in the current file using fuzzy search.

Code

```
1// Go To Symbol - navigate to functions, classes, variables2// macOS: ⇧⌘O3// Windows/Linux: Ctrl+Shift+O4
5// Shows all symbols in current file:6// - Functions7// - Classes8// - Variables9// - Methods10// - Constants11
12// You can also:13// - Type to filter symbols by name14// - Use @ prefix in command palette for same functionality15// - Group symbols by category (@:)
```

-   Shows symbol outline and hierarchy
-   Can type to filter results quickly
-   Works with all code languages
-   Requires language server support for best results

## Sidebars & Views

Access and control VS Code sidebars and view panels

### Toggle Sidebars and Panels

Show and hide explorer, search, debug, and source control panels

#### Accessibility

Easy access to sidebar panels for file exploration and debugging

#### Best Practices

-   Toggle sidebar frequently to maximize editing space
-   Jump directly to needed view with specific shortcut
-   Learn shortcuts for views you use most

#### Common Errors

-   **Shortcut opens wrong sidebar:** Check keyboard preferences; shortcuts may conflict with other applications

#### Keywords

sidebarpaneltoggleexplorersearch

[Learn more](https://code.visualstudio.com/docs/getstarted/userinterface)

#### Toggle primary sidebar

Toggle the primary sidebar visibility to gain more editor space. Sidebar reopens when toggled again.

Code

```
1// Toggle Primary Sidebar (Explorer, Search, Debug, Extensions, SCM)2// macOS: ⌘B3// Windows/Linux: Ctrl+B4
5// Sidebars in VS Code:6// - Explorer (⇧⌘E): File tree navigation7// - Search (⇧⌘F): Search across files8// - Debug (⇧⌘D): Debug controls and breakpoints9// - Extensions (⇧⌘X): Install and manage extensions10// - SCM (⇧^G on Mac, Ctrl+Shift+G on Windows): Git/version control11
12// Toggling gives more editor space when not needed13// Sidebar state is remembered when reopened
```

-   Toggle it off when you need the full editor width
-   Individual panels show different views
-   Sidebar width is adjustable
-   Can open multiple sidebars simultaneously

#### Open specific sidebar views

Direct keyboard shortcuts to jump to specific sidebar views without navigating through tabs.

Code

```
1// Open Specific Sidebar Views:2
3// Explorer View - browse and open files4// macOS: ⇧⌘E5// Windows/Linux: Ctrl+Shift+E6
7// Search View - find in files8// macOS: ⇧⌘F9// Windows/Linux: Ctrl+Shift+F10
11// Debug View - manage breakpoints and debugging12// macOS: ⇧⌘D13// Windows/Linux: Ctrl+Shift+D14
15// Source Control View - git operations16// macOS: ⇧^G (Shift+Control+G)17// Windows/Linux: Ctrl+Shift+G18
19// Extensions View - browse and install extensions20// macOS: ⇧⌘X21// Windows/Linux: Ctrl+Shift+X22
23// Each opens sidebar to that specific panel
```

-   Faster than clicking sidebar icons
-   Automatically focuses the sidebar
-   Repeated press toggles sidebar closed
-   Each view maintains its scroll position

### Bottom Panel and Terminal

Manage the bottom panel for terminal, problems, debug console

#### Accessibility

Control bottom panel for terminal and diagnostic information

#### Best Practices

-   Use integrated terminal for quick commands
-   Create separate terminals for long-running processes
-   Use multiple terminals for parallel work

#### Common Errors

-   **Terminal shows wrong shell:** Change default shell in VS Code settings (terminal.integrated.defaultProfile.linux/osx/windows)

#### Keywords

panelterminalproblemsconsoleoutput

[Learn more](https://code.visualstudio.com/docs/editor/integrated-terminal)

#### Toggle bottom panel

Toggle the bottom panel to show/hide terminal and diagnostic information, giving more vertical editor space.

Code

```
1// Toggle Bottom Panel (Terminal, Problems, Output, Debug Console)2// macOS: ⌘J3// Windows/Linux: Ctrl+J4
5// Bottom panel contains:6// - Terminal: Run commands and scripts7// - Problems: Linter/compiler errors and warnings8// - Output: Extension and language server messages9// - Debug Console: Debugger output and REPL10
11// Panel tabs appear at bottom when open12// Click tabs to switch between different panels13// Panel height is adjustable by dragging top border
```

-   Terminal persists when panel is hidden
-   Multiple terminal tabs supported
-   Problem panel shows all errors/warnings across workspace
-   Commonly toggled during focused editing

#### Open terminal

Quickly open the integrated terminal within VS Code instead of switching to external terminal application.

Code

```
1// Open Integrated Terminal2// macOS: ^` (Control+Backtick)3// Windows/Linux: Ctrl+`4
5// The terminal:6// - Runs in VS Code's bottom panel7// - Uses your default shell (bash, zsh, PowerShell)8// - Maintains current working directory context9// - Supports multiple terminal instances10
11// Terminal shortcuts:12// - Create new terminal: Ctrl+Shift+` (Cmd+Shift+` on Mac)13// - Switch terminals: Alt+arrow keys14// - Kill terminal: Ctrl+Shift+W (Cmd+Shift+W on Mac)
```

-   Terminal is part of VS Code workflow
-   Support for multiple tabs in terminal
-   Remembers last directory and text
-   Can split terminals side-by-side

## Editor Management

Manage splits, tabs, and editor groups

### Split Editors

Open files side-by-side in split view

#### Accessibility

Arrange editors for side-by-side comparison and parallel editing

#### Best Practices

-   Use splits for comparing implementations or files
-   Arrange splits to minimize head turning
-   Close unused groups to regain editor width

#### Common Errors

-   **Focus not changing between groups:** Remember to release Ctrl+K before pressing arrow key; must be two separate key presses

#### Keywords

spliteditorgroupsside-by-sidecompare

[Learn more](https://code.visualstudio.com/docs/editor/editor-groups)

#### Split editor horizontally

Split the editor horizontally to view and edit two files side-by-side, useful for comparing implementations or referencing code.

Code

```
1// Split Editor Horizontally (side by side)2// macOS: ⌘\3// Windows/Linux: Ctrl+\4
5// Creates a new editor group to the right6// - Current file stays in left group7// - New empty group appears on right8// - Drag tabs between groups to move files9// - Close group by closing all tabs in it10
11// You can create multiple splits:12// - Up to 4 editor groups (2x2 grid)13// - Use keyboard shortcuts to focus each group14// - Drag files between groups
```

-   Can create multiple splits for complex workflows
-   Resize splits by dragging dividers
-   Each group maintains independent scroll position
-   Recommended for comparing related files

#### Navigate between editor groups

Navigate focus between multiple editor groups when using split editors for organized code comparison.

Code

```
1// Navigate Between Editor Groups:2
3// Focus left group4// macOS: ⌘K ⌘← (⌘K then ⌘←)5// Windows/Linux: Ctrl+K Ctrl+←6
7// Focus right group8// macOS: ⌘K ⌘→ (⌘K then ⌘→)9// Windows/Linux: Ctrl+K Ctrl+→10
11// Focus up group12// macOS: ⌘K ⌘↑13// Windows/Linux: Ctrl+K Ctrl+↑14
15// Focus down group16// macOS: ⌘K ⌘↓17// Windows/Linux: Ctrl+K Ctrl+↓18
19// Method: Press Ctrl+K, release, then press arrow
```

-   Ctrl+K is the group focus modifier key
-   Release Ctrl+K before pressing the arrow key
-   Tab order follows physical layout (left, right, up, down)
-   Focus determines where new files open

### Zen Mode

Full-screen editing with minimal UI

#### Accessibility

Distraction-free editing mode for focused work

#### Best Practices

-   Use Zen mode for long writing sessions
-   Close unmodified tabs regularly
-   Combine multiple view shortcuts for custom workflow

#### Common Errors

-   **Cannot exit Zen mode:** Press Ctrl+K Z again or press Escape to exit

#### Keywords

zenfocusfullscreendistractionminimalist

[Learn more](https://code.visualstudio.com/docs/editor/zen)

#### Toggle Zen mode

Enter distraction-free editing mode showing only your code, useful for focused work on complex problems.

Code

```
1// Zen Mode - Distraction-free full-screen editing2// macOS: ⌘K Z (⌘K then Z)3// Windows/Linux: Ctrl+K Z4
5// Zen mode hides:6// - Sidebars7// - Bottom panel8// - Status bar (optional)9// - Activity bar10// - Tab bar (optional)11// - Breadcrumbs (optional)12
13// Perfect for:14// - Focused writing of long functions15// - Deep code review sessions16// - Presentations or live coding17// - Minimizing distractions during debugging18
19// Exit Zen mode:20// - Press Ctrl+K Z again (or ⌘K Z on Mac)21// - Press Escape
```

-   Preserves window layout when exiting
-   Can configure what gets hidden in settings
-   Toggling again exits immediately
-   Often used for live coding presentations

#### Close unmodified tabs

Quickly close unedited tabs to reduce clutter and keep your workspace organized.

Code

```
1// Close Unmodified Tabs and Groups2
3// Close unmodified tabs in current group4// macOS: ⌘K U5// Windows/Linux: Ctrl+K U6
7// Close all tabs in current group8// macOS: ⌘K W9// Windows/Linux: Ctrl+K W10
11// Close all editor groups12// macOS: ⌘K ⌘W13// Windows/Linux: Ctrl+K Ctrl+W14
15// Useful for cleanup and organization16// Only closes tabs with no unsaved changes
```

-   Prevents accidental closing of modified files
-   Only affects current editor group
-   Useful after large refactoring sessions

## Text Editing

Core editing shortcuts for text manipulation

### Line Operations

Cut, copy, paste, and manipulate lines

#### Accessibility

Essential text editing shortcuts for rapid code changes

#### Best Practices

-   Use ⌘X instead of select+cut; it acts on the whole line
-   Duplicate lines for quick scaffolding
-   Move lines instead of cut/paste

#### Common Errors

-   **Line moved to unexpected position:** Check that correct line is selected; move operates on line(s) containing cursor

#### Keywords

cutcopypastedeletelineundo

[Learn more](https://code.visualstudio.com/docs/editor/codebasics)

#### Cut, copy, and paste

Basic editing operations. Cut and copy without selection manipulate entire lines automatically.

Code

```
1// Cut, Copy, and Paste Operations:2
3// Cut line (removes and copies)4// macOS: ⌘X5// Windows/Linux: Ctrl+X6
7// Copy line (copies without removing)8// macOS: ⌘C9// Windows/Linux: Ctrl+C10
11// Paste12// macOS: ⌘V13// Windows/Linux: Ctrl+V14
15// Note: Works on current line even without selection16// Cut/copy with no selection operates on entire line17// Pasting multiple lines inserts them as separate lines
```

-   No need to select entire line for cut/copy
-   Cursor position determines which line
-   Works with multiple selections
-   Clipboard shared with system

#### Delete and duplicate lines

Line manipulation shortcuts that act on the current line without an explicit selection.

Code

```
1// Delete Lines2// macOS: ⌘⇧K3// Windows/Linux: Ctrl+Shift+K4
5// Deletes current line or selected lines6// More efficient than select+delete7// Cursor stays at same position8
9// Duplicate Line Down10// macOS: ⌥⇧↓ (Option+Shift+Down)11// Windows/Linux: Ctrl+Shift+D12
13// Creates copy of line below current line14// Useful for:15// - Creating similar code patterns16// - Testing variations17// - Quick scaffolding18
19// Move Line Up/Down20// macOS: ⌥↑ / ⌥↓ (Option+Up/Down)21// Windows/Linux: Alt+Up / Alt+Down22
23// Moves current line up or down24// Works with multiple selected lines
```

-   Delete line doesn't copy to clipboard
-   Duplicate line doesn't affect cursor column
-   Move line preserves indentation
-   Works with multiple selected lines

### Selection and Navigation

Select text and navigate within files

#### Accessibility

Efficient text selection and cursor movement

#### Best Practices

-   Learn word navigation; it covers more ground than arrow keys
-   Use selection with navigation for bulk editing
-   Combine with multiple cursors to edit several lines at once

#### Common Errors

-   **Selection not working as expected:** Hold Shift while navigating with Ctrl+arrows to extend selection

#### Keywords

selectselectionwordnavigatearrowexpand

[Learn more](https://code.visualstudio.com/docs/editor/codebasics)

#### Select word and expand selection

Quickly select and modify all occurrences of a word without regex or find/replace dialog.

Code

```
1// Select Word at Cursor2// macOS: ⌘D3// Windows/Linux: Ctrl+D4
5// Selects the word under cursor6// Press again to add next occurrence to selection7// Useful for renaming and bulk replacement8
9// Expand Selection to Word10// macOS: ⌘D (same as select word)11// Windows/Linux: Ctrl+D12
13// Each subsequent press:14// 1. Selects current word15// 2. Adds next occurrence16// 3. Continues selecting all occurrences17
18// Escape to stop multi-select19
20// Expand Selection Bracket21// macOS: ⌘⇧\22// Windows/Linux: Ctrl+Shift+\23
24// Selects content until matching bracket25// Useful for selecting entire blocks
```

-   Each press selects the next occurrence
-   Good for renaming a variable throughout a file
-   Faster than find and replace for simple cases
-   Escape key clears multi-selection

#### Move cursor by word and line

Move through code word by word and line by line instead of holding the arrow keys.

Code

```
1// Navigate by Word2// macOS: ⌥← / ⌥→ (Option+Left/Right)3// Windows/Linux: Ctrl+Left / Ctrl+Right4
5// Move cursor to next word boundary6// Option+Left moves to start of current/previous word7// Option+Right moves to end of next word8
9// Select While Moving by Word10// macOS: ⌥⇧← / ⌥⇧→ (Option+Shift+Left/Right)11// Windows/Linux: Ctrl+Shift+Left/Right12
13// Extends selection word by word14// Useful for selecting multiple words15
16// Jump to Line Start/End17// macOS: ⌘← / ⌘→ (Command+Left/Right)18// Windows/Linux: Home / End19
20// Moves cursor to start or end of line21// Select with Cmd+Shift+Left/Right
```

-   Word navigation respects camelCase and underscores
-   Ctrl+Left/Right is faster than individual arrow keys
-   Selection shortcuts extend with Shift
-   Home/End keys for line boundaries on Windows/Linux

## Find & Replace

Search and replace text in files and workspace

### Find and Replace

Basic find and replace operations in current file

#### Accessibility

Quick find and replace within single files

#### Best Practices

-   Use Match Case for case-sensitive replacements
-   Preview single replacements before Replace All
-   Learn regex for complex replacements

#### Common Errors

-   **Replace All changes unexpected text:** Enable Match Case or Whole Word if needed; test with Find first

#### Keywords

findreplacesearchtextfile

[Learn more](https://code.visualstudio.com/docs/editor/find-and-replace)

#### Find text in current file

Search for text within current file with highlighting and count of matches found.

Code

```
1// Find in Current File2// macOS: ⌘F3// Windows/Linux: Ctrl+F4
5// Opens find dialog at top of editor6// Features:7// - Type text to search8// - Highlights all matches in file9// - Shows match count10// - Navigate with arrow buttons or Enter11// - Close with Escape12
13// Find Options:14// - Match Case (⌥⌘C): Case-sensitive matching15// - Match Whole Word (⌥⌘W): Only whole words16// - Use Regular Expression (⌥⌘R): Pattern matching17
18// Navigation:19// - Enter or down arrow: next match20// - Shift+Enter: previous match
```

-   Matches are highlighted in the editor
-   Current match has different highlighting
-   Find dialog is non-modal; you can still edit
-   Search results update as you type

#### Find and replace in current file

Search and replace text in current file with options for exact and pattern-based matching.

Code

```
1// Find and Replace in Current File2// macOS: ⌥⌘F3// Windows/Linux: Ctrl+H4
5// Opens find and replace dialog6// First field: text to find7// Second field: replacement text8
9// Replace Options:10// - Replace (⌘⇧1): Replace current match11// - Replace All (⌘⌥⇧Enter): All matches at once12// - Regular expressions: Enable for pattern replacement13
14// Example regex replace:15// Find: console\.log\((.*)\)16// Replace: console.warn($1)17// This changes all console.log to console.warn18
19// Common use cases:20// - Rename variables across file21// - Update import statements22// - Fix formatting issues
```

-   Replace All is dangerous; preview changes first
-   Can use regex with capture groups ($1, $2, etc.)
-   Undo works on all replacements
-   Case sensitivity and whole word options available

### Find in Files and Workspace

Search across multiple files in workspace

#### Accessibility

Search entire workspace for text patterns

#### Best Practices

-   Always test Find before Replace All
-   Use exclude patterns to skip unneeded folders
-   Verify regex replacements on small sets first

#### Common Errors

-   **Replaced wrong files across workspace:** Use git to revert; always commit before large workspace replacements

#### Keywords

workspacefilessearchglobalfindall

[Learn more](https://code.visualstudio.com/docs/editor/find-and-replace)

#### Find in all files

Search for text across entire workspace showing results grouped by file and line number.

Code

```
1// Find in All Files (Workspace Search)2// macOS: ⇧⌘F3// Windows/Linux: Ctrl+Shift+F4
5// Opens Find in Files panel6// Features:7// - Searches entire workspace8// - Shows results by file9// - Expandable file results10// - Click result to open file11// - Shows line number and match12
13// Scope Options:14// - Search in: Select folders to include15// - Exclude from: Specify patterns to skip16// - Default excludes: node_modules, .git, etc.17
18// Search across project:19// - Type search term20// - Results grouped by file21// - Results count at top22// - Click file to open and navigate
```

-   Results are interactive; click to open file
-   Can filter results by file pattern
-   Respects .gitignore automatically
-   Useful for finding all usages of a function

#### Replace in all files

Search and replace across entire workspace, useful for large refactoring operations.

Code

```
1// Replace in All Files2// macOS: ⇧⌘H3// Windows/Linux: Ctrl+Shift+H4
5// Opens Find and Replace in Files panel6// Works like Find & Replace but across workspace7
8// Features:9// - Replace single occurrence10// - Replace all in file11// - Replace all in workspace12// - Shows files that will be changed13// - Undo operates globally14
15// Warning: Replace All changes many files16// Use Replace Current first to verify17// Can undo entire operation if needed18
19// Regex support:20// - Enable Use Regular Expression21// - Use capture groups in replacement22// - Particularly useful with multiple files
```

-   Shows preview of what will change
-   Can exclude files from search before replacing
-   Reaches every matching file, so check the preview first
-   Undo works after replacing all files

## Debugging

Debug code using breakpoints and stepping

### Debug Control and Breakpoints

Start, stop, and control program execution

#### Accessibility

Control program execution for debugging

#### Best Practices

-   Use F9 to toggle quick breakpoints
-   Use conditional breakpoints to reduce stopping
-   Use logpoints for quick temporary logging

#### Common Errors

-   **Breakpoint not hit during debugging:** Check debug configuration; ensure breakpoint is in code path being executed

#### Keywords

debugbreakpointrunstoppausestep

[Learn more](https://code.visualstudio.com/docs/editor/debugging)

#### Start and stop debugging

Control program execution while debugging to find and fix issues.

Code

```
1// Start Debugging2// Key: F53
4// Starts debugger using launch configuration5// Pauses at first breakpoint6// Opens Debug panel on left sidebar7
8// Stop Debugging9// Key: Shift+F510
11// Terminates debug session12// Returns to normal editing mode13// Clears all breakpoints (false; they remain)14
15// Restart Debugging16// Key: Shift+Ctrl+F5 (or Cmd+Shift+F5 on Mac)17
18// Restarts current debug session19// Useful when testing changes20// Faster than stop and start21
22// Pause/Resume23// Click pause button or press F5 when running24// Pause stops execution at current line25// Resume continues from pause point
```

-   Requires debug configuration in launch.json
-   F5 continues if paused; pauses if running
-   Debug variables available in Debug Console
-   Can modify variables during debugging

#### Set and toggle breakpoints

Set breakpoints to pause execution at specific points for inspection and debugging.

Code

```
1// Toggle Breakpoint2// Key: F93
4// On current line: sets breakpoint (breaks execution)5// On existing breakpoint: removes it6// Shows red dot on line number7// Useful for testing specific code paths8
9// Conditional Breakpoint10// Right-click on line number and select "Add Conditional Breakpoint"11// Express condition that line must satisfy to break12// Example: i > 100  (breaks when i > 100)13// Useful for skipping many iterations14
15// Logpoint (Log Without Breaking)16// Right-click on line number and select "Add Logpoint"17// Message logged to console without breaking execution18// Useful for tracing values without stopping19// Example: "Current value: {value}"20
21// Breakpoint Widgets:22// - View all breakpoints in Debug panel23// - Enable/disable without removing24// - Click to navigate to breakpoint location
```

-   Red dot indicates active breakpoint
-   Gray dot indicates disabled breakpoint
-   Conditional breakpoints have orange dot
-   Logpoints have yellow dot
-   All breakpoints shown in Debug panel

### Debug Stepping

Step through code line by line

#### Accessibility

Execute code line-by-line for detailed inspection

#### Best Practices

-   Start with Step Over to understand flow
-   Use Step Into for specific function inspection
-   Watch variables that matter to your problem

#### Common Errors

-   **Variables show undefined values:** Variable may be out of scope; check call stack and current scope in Variables panel

#### Keywords

stepintooveroutnextcontinue

[Learn more](https://code.visualstudio.com/docs/editor/debugging)

#### Step through code execution

Navigate through code execution line by line or function by function to trace program behavior.

Code

```
1// Step Over (Execute Line, Don't Enter Functions)2// Key: F103
4// Executes current line completely5// If line calls function, executes entire function6// Moves to next line in current function7// Best for skipping internal function details8
9// Step Into (Enter Function Calls)10// Key: F1111
12// Steps into function calls on current line13// Pauses at first line inside function14// Allows detailed inspection of function15// Use multiple times to dive deeper16
17// Step Out (Exit Current Function)18// Key: Shift+F1119
20// Executes rest of current function21// Pauses at return point in calling function22// Useful when already inside wrong function23// Brings you back up call stack24
25// Continue (Run to Next Breakpoint)26// Press F5 while paused27// Resumes execution28// Runs until next breakpoint or end
```

-   Step Over best for high-level understanding
-   Step Into for inspecting function details
-   Green arrow shows next line to execute
-   Call stack shown in Debug panel
-   Variables update after each step

#### Debug console and variable inspection

Inspect program state and evaluate expressions while debugging to understand variable values and behavior.

Code

```
1// Debug Console2// Key: Shift+Ctrl+Y (or Cmd+Shift+Y on Mac)3
4// Shows program output and allows REPL5// Type expressions to evaluate while paused6// View console.log() output here7
8// Variables View (Debug Sidebar)9// Shows variables in current scope10// Local variables: scoped to current function11// Global variables: workspace-wide variables12// Expand objects to inspect properties13
14// Watch Expressions15// Add custom expressions to watch16// Right-click variable and "Add to Watch"17// Or add expression manually to Watch panel18// Updates after each step19
20// Hover Over Variables21// Mouse over variable in editor while paused22// Shows current value in tooltip23// Works for object properties too24// Useful while reading code
```

-   Debug Console supports JavaScript/TypeScript REPL
-   Variables panel refreshes after each step
-   Watch expressions help when tracking several values at once
-   Hover tooltip appears immediately while paused

## Multi-Cursor & Selection

Edit multiple locations simultaneously

### Multi-Cursor Editing

Add cursors at multiple positions and edit simultaneously

#### Accessibility

Edit multiple locations at same time

#### Best Practices

-   Use for editing multiple similar lines
-   Combine with line duplication for scaffolding
-   Use Escape if multiple cursors become confusing

#### Common Errors

-   **Typing affects only one cursor:** Check that all cursors are visible; refresh with click if needed

#### Keywords

cursormultimultipleeditparallel

[Learn more](https://code.visualstudio.com/docs/editor/codebasics)

#### Add cursor above and below

Create multiple cursors to edit several lines in parallel instead of repeating the same edit.

Code

```
1// Add Cursor Below2// macOS: ⌥⌘↓3// Windows/Linux: Ctrl+Alt+Down4
5// Creates new cursor on next line at same column6// Repeated presses add more cursors below7// Useful for parallel editing of multiple lines8// All cursors type/edit simultaneously9
10// Add Cursor Above11// macOS: ⌥⌘↑12// Windows/Linux: Ctrl+Alt+Up13
14// Creates new cursor on previous line at same column15// Works upward from current position16// Useful for editing multiple similar lines together17
18// Example use case:19// const name = "John";20// const age = 30;21// const city = "NYC";22
23// Add cursors at start of each line24// Edit all variable names simultaneously
```

-   Each cursor operates independently but simultaneously
-   All cursors visible as thin vertical lines
-   Escape key to clear all but one cursor
-   Well suited to editing structured data

#### Multi-cursor with selection

Select all occurrences of word at once and edit all simultaneously, faster than find and replace for simple cases.

Code

```
1// Select All Occurrences2// macOS: ⌘⇧L  (not standard, need to enable)3// Windows/Linux: Ctrl+Shift+L4
5// Adds cursor at each occurrence of selected text6// Selects the text at each cursor7// Allows bulk renaming or editing8
9// Alternative: Ctrl+D for incremental selection10// macOS: ⌘D11// Windows/Linux: Ctrl+D12
13// Each press:14// 1. Selects current word15// 2. Adds next occurrence16// 3. Continues until all selected17
18// Example workflow:19// 1. Select a word (double-click or Ctrl+D)20// 2. Press Ctrl+Shift+L to select all21// 3. Type replacement text22// 4. All instances updated simultaneously
```

-   Much faster than traditional find/replace
-   No need for regex or dialog
-   Good for renaming a variable in one pass
-   Escape to clear selection

## Advanced Features

Go to definition, references, and code actions

### Go to Definition and References

Navigate to function and variable definitions

#### Accessibility

Quick navigation to code definitions and usages

#### Best Practices

-   Use F12 to understand code flow
-   Use Shift+F12 before renaming to verify impact
-   Use Peek Definition for quick inspection

#### Common Errors

-   **Go to Definition does not work:** Language server may not be installed; check Extensions and install if needed

#### Keywords

definitionreferencesusagegotojumppeek

[Learn more](https://code.visualstudio.com/docs/editor/codebasics)

#### Go to definition

Jump directly to function and variable definitions without searching through the codebase.

Code

```
1// Go To Definition2// Key: F123
4// Opens file and scrolls to function/variable definition5// Requires language server support6// Works for:7// - User-defined functions8// - Class methods9// - Variable declarations10// - Imported definitions11
12// Peek Definition13// macOS: ⌥F1214// Windows/Linux: Ctrl+Alt+F1215
16// Shows definition in inline preview17// Doesn't open new file18// Shows code without navigating19// Press Escape to close preview20
21// Back Navigation22// macOS: ⌃- (Control+Minus/Dash)23// Windows/Linux: Ctrl+Alt+Left24
25// Goes back to previous location26// Maintains navigation history27// Useful after multiple jumps
```

-   Requires TypeScript/JavaScript language server
-   Works with other languages that have language servers
-   Peek definition is non-intrusive
-   Works across files and modules

#### Find all references

Locate all places where a function or variable is used, useful for understanding code dependencies and impact of changes.

Code

```
1// Go To References2// Key: Shift+F123
4// Shows all places where function/variable is used5// Opens References panel6// Lists all usages across codebase7// Click to navigate to each usage8
9// Peek References10// Right-click on symbol > "Peek References"11// Shows references in inline view12// Similar to Peek Definition13// Close with Escape14
15// Find All References (Command Palette)16// Command: "Go to All References"17// Shows references in split view18// More detailed than Peek References19
20// Use cases:21// - Find where function is called22// - Check variable usage before renaming23// - Understand code dependencies24// - Locate dead code
```

-   Shift+F12 opens dedicated References panel
-   Can filter results by type (read/write/declare)
-   Worth running before a refactor
-   Results grouped by file

### Code Actions and Quick Fixes

Apply automatic fixes and refactoring suggestions

#### Accessibility

Automatic code improvements and fixes

#### Best Practices

-   Use Ctrl+. frequently to discover available actions
-   Refactor with Extract Variable for complex expressions
-   Let language server suggest improvements

#### Common Errors

-   **Quick Fix menu does not appear:** Light bulb only appears for addressable errors; check if error is fixable

#### Keywords

actionfixrefactorautosuggestionimplement

[Learn more](https://code.visualstudio.com/docs/editor/refactoring)

#### Quick fix and code actions

Automatically apply fixes and refactoring suggestions offered by VS Code's language servers and extensions.

Code

```
1// Quick Fix2// macOS: ⌘.3// Windows/Linux: Ctrl+.4
5// Shows available fixes for error/warning at cursor6// Common fixes include:7// - Import missing module8// - Add missing parameter9// - Create missing variable10// - Generate method stub11// - Format code12
13// Trigger automatically:14// Light bulb icon appears when fixes available15// Click bulb or use Ctrl+. shortcut16// Select fix from menu17
18// Available for:19// - Syntax errors with solutions20// - Linter/formatter suggestions21// - Language-specific refactoring22// - Extension-provided actions23
24// Common fixes:25// - "Add missing import" - automatic import26// - "Generate method" - stub out function27// - "Fix capitalization" - correct case28// - "Convert var to let" - modernize code
```

-   Light bulb appears when actions available
-   Shortcut varies by platform
-   Many fixes require extensions
-   TypeScript provides extensive fixes

#### Refactoring with code actions

Perform refactoring transformations like extracting functions and variables automatically.

Code

```
1// Refactoring Actions2// Use Ctrl+. (Cmd+. on Mac) on selection3
4// Available refactorings (TypeScript/JavaScript):5// - Extract Variable: Extract expression to variable6// - Extract Function: Extract lines to new function7// - Extract Interface: Extract type to interface8// - Move Statements: Move code block to different location9// - Rename Symbol: Rename with occurrences updated10// - Generate getter/setter: Create property accessors11// - Convert to async: Convert function to async/await12// - Add/remove braces: Formatting changes13
14// Example: Extract Variable15// Highlight: calculateTotal(price * quantity + tax)16// Quick Fix > Extract Variable17// Creates: const extracted = price * quantity + tax;18
19// Example: Extract Function20// Select multiple lines21// Quick Fix > Extract to Function22// Creates function with extracted code
```

-   Refactoring availability depends on language
-   TypeScript has the widest range of refactorings
-   Most refactoring requires text selection first
-   Changes typically can be undone easily

## Extension Management

Install, manage and configure VS Code extensions

### Installing and Managing Extensions

Add and configure extensions to extend VS Code functionality

#### Accessibility

Install and manage extensions for enhanced functionality

#### Best Practices

-   Only install extensions you actually use
-   Disable extensions that slow VS Code
-   Use workspace-specific extensions for projects

#### Common Errors

-   **Extension installed but not working:** Try reloading window with Ctrl+Shift+P > "Reload Window"

#### Keywords

extensioninstallmarketplaceplugindisableuninstall

[Learn more](https://code.visualstudio.com/docs/editor/extension-marketplace)

#### Open extensions view

Access the Extensions Marketplace to discover and install extensions for additional functionality.

Code

```
1// Open Extensions Sidebar2// macOS: ⇧⌘X3// Windows/Linux: Ctrl+Shift+X4
5// Shows VS Code Extensions Marketplace6// Features:7// - Search for extensions by name8// - Shows ratings and downloads9// - Install with single click10// - View extension details and reviews11// - See installed extensions12
13// Install Extension:14// 1. Click Extensions icon in sidebar15// 2. Search for extension name16// 3. Click Install button17// 4. Wait for installation (usually instant)18// 5. May need reload for activation19
20// Manage Installed Extensions:21// - Disable: Turn off without uninstalling22// - Uninstall: Remove completely23// - Settings: Configure extension options24// - Show in Marketplace: View extension page
```

-   Most extensions install instantly
-   Some require window reload
-   Extensions can be workspace-specific
-   Disabled extensions don't affect performance

#### Configure extensions and settings

Configure extension settings and choose the productivity extensions that fit your workflow.

Code

```
1// Extension Settings2// Extended settings for installed extensions appear in:3// - Settings > Extensions section4// - Right-click extension > Extension Settings5// - Edit in settings.json6
7// Common Extension Types:8// - Language Support: Syntax highlighting, IntelliSense9// - Formatters: Code formatting and beautification10// - Linters: Code quality and style checking11// - Debuggers: Language-specific debugging12// - Themes: Visual appearance customization13// - Keybindings: Alternative keyboard layouts14// - Snippets: Code templates and shortcuts15
16// Recommended Essential Extensions:17// - Language Support: TypeScript, Python, Go, Rust18// - Formatters: Prettier, Pylint19// - Linters: ESLint, Pylint20// - Version Control: GitHub, GitLens21// - Debug: Debugger for Chrome, Python22// - Productivity: REST Client, Thunder Client23// - Snippets: Popular languages have snippet packs24
25// Performance:26// - Disable unused extensions27// - Check extension page for performance notes28// - Some extensions slow startup
```

-   Extensions can be disabled per workspace
-   Many extensions auto-detect project type
-   Check extension ratings and reviews before installing
-   Popular extensions are well-maintained

Was this useful?

## Tags

#VS Code#Visual Studio Code#Keyboard Shortcuts#Editor#Development#Productivity

## Share

[Facebook](https://facebook.com/sharer/sharer.php?u=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fvscode "Share on Facebook")[Twitter](https://twitter.com/intent/tweet/?text=VS%20Code&url=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fvscode "Share on Twitter")[LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fvscode&title=VS%20Code&summary=Complete%20VS%20Code%20keyboard%20shortcuts%20reference%20including%20command%20palette%2C%20navigation%2C%20editing%2C%20debugging%2C%20multicursor%20operations%2C%20and%20advanced%20features%20for%20macOS%20and%20Windows%2FLinux&source=https://mkabumattar.com "Share on LinkedIn")[WhatsApp](https://wa.me/?text=VS%20Code%20https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fvscode "Share on WhatsApp")[Telegram](https://t.me/share/url?url=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fvscode&text=VS%20Code "Share on Telegram")[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fvscode&title=VS%20Code "Share on Reddit")[Hacker News](http://news.ycombinator.com/submitlink?u=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fvscode&t=VS%20Code "Share on Hacker News")[Pinterest](https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fvscode&media=&description=Complete%20VS%20Code%20keyboard%20shortcuts%20reference%20including%20command%20palette%2C%20navigation%2C%20editing%2C%20debugging%2C%20multicursor%20operations%2C%20and%20advanced%20features%20for%20macOS%20and%20Windows%2FLinux "Share on Pinterest")[Email](<mailto:?subject=VS%20Code&body=Check out this article: https%3A%2F%2Fmkabumattar.com%2Fcheatsheets%2Fvscode>)

## Comments

## You might also enjoy

More posts on similar topics

## [Vim](/cheatsheets/vim)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   Editor
-   Text Editor
-   Terminal
-   Command Line
-   Productivity

Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems. The sections below cover Vim commands, sho

#Editor#Vim#Text Editor+3 tags

[read more](/cheatsheets/vim)

## [Git](/cheatsheets/git)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   Version Control
-   Git
-   SCM
-   Collaboration
-   Development Tools

Git is a distributed version control system. Developers use it to track code changes, collaborate with teams, and manage project history. Most software teams build their workflow around it. Key co

#Git#Version Control#Branches+5 tags

[read more](/cheatsheets/git)

## [Python Virtual Environments Cheatsheet](/cheatsheets/python-venv)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   Python
-   Development Tools
-   Dependency Management

A fast reference for keeping Python projects isolated and reproducible. It covers creating and activating environments with venv, installing packages with pip, locking dependencies with requirements f

#Python#Virtualenv#Pip+5 tags

[read more](/cheatsheets/python-venv)

## [Screen](/cheatsheets/screen)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   Terminal
-   Screen
-   Tools
-   Development
-   System Administration

Getting started GNU Screen is a terminal multiplexer that gives you:Sessions: Full terminal environments that persist even if you disconnect Windows: Multiple terminals (tabs) within

#Screen#Terminal Multiplexer#Sessions+2 tags

[read more](/cheatsheets/screen)

## [Tmux](/cheatsheets/tmux)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   Terminal
-   Tmux
-   Tools
-   Development
-   System Administration

Tmux is a terminal multiplexer for managing multiple terminal sessions, windows, and panes within a single screen. This cheatsheet covers the commands, keybindings, and configuration options for every

#Tmux#Terminal Multiplexer#Sessions+3 tags

[read more](/cheatsheets/tmux)

## [Chmod](/cheatsheets/chmod)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   Terminal
-   Programming
-   Linux
-   File Management
-   Tools

Complete chmod reference covering file permissions, recursive changes with -v and -c, reference mode, logical operators, batch operations, practical examples, and security best practices for Linux fil

#Chmod#Permissions#File Permissions+5 tags

[read more](/cheatsheets/chmod)

6 related posts
