VS Code Keyboard Shortcuts Cheat Sheet

New

Essential VS Code shortcuts for editing, navigation, debugging, and the integrated terminal

General

Command Palette

Access any command by name

Mac: Cmd+Shift+P Win: Ctrl+Shift+P

Quick Open (File)

Open a file by name instantly

Mac: Cmd+P Win: Ctrl+P

Settings

Open user or workspace settings

Mac: Cmd+, Win: Ctrl+,

Toggle Terminal

Open or focus the integrated terminal

Mac: Ctrl+` Win: Ctrl+`

Close Editor

Close the active editor tab

Mac: Cmd+W Win: Ctrl+W

Editing

Multi-Cursor

Add cursors to edit multiple locations at once

Mac: Option+Click (add cursor) Cmd+Option+Down/Up (add cursor below/above) Win: Alt+Click Ctrl+Alt+Down/Up

Select Next Occurrence

Add the next match to selection (multi-cursor rename)

Mac: Cmd+D Win: Ctrl+D

Move Line Up/Down

Reorder lines without cut/paste

Mac: Option+Up / Option+Down Win: Alt+Up / Alt+Down

Duplicate Line

Copy the current line below

Mac: Option+Shift+Down Win: Shift+Alt+Down

Toggle Comment

Comment or uncomment selected lines

Mac: Cmd+/ Win: Ctrl+/

Format Document

Auto-format the entire file

Mac: Option+Shift+F Win: Shift+Alt+F

Expand Selection

Expand selection to next scope level

Mac: Cmd+Shift+Right Win: Shift+Alt+Right

Navigation

Go to Definition

Jump to where a symbol is defined

Mac/Win: F12 Mac: Cmd+Click

Peek Definition

Preview definition inline without leaving current file

Mac: Option+F12 Win: Alt+F12

Go to Symbol

Search for a symbol in the current file

Mac: Cmd+Shift+O Win: Ctrl+Shift+O

Go to Line

Jump to a specific line number

Mac: Ctrl+G Win: Ctrl+G

Breadcrumbs Navigation

Navigate the symbol path in the breadcrumbs bar

Mac/Win: Focus breadcrumbs with Ctrl+Shift+.

Search & Replace

Find in File

Search within the current file

Mac: Cmd+F Win: Ctrl+F

Find & Replace

Find and replace within the current file

Mac: Cmd+H Win: Ctrl+H

Search Across Files

Search the entire workspace

Mac: Cmd+Shift+F Win: Ctrl+Shift+F

Split Editor & Tabs

Split Editor

Split the editor to the right

Mac: Cmd+\ Win: Ctrl+\

Switch Editor Groups

Move focus between split editor groups

Mac/Win: Ctrl+1, Ctrl+2, Ctrl+3

Navigate Tabs

Cycle through open editor tabs

Mac: Ctrl+Tab (next), Ctrl+Shift+Tab (prev) Win: Ctrl+Tab

Debugging

Start / Continue

Start debugging session or continue execution

Mac/Win: F5

Step Over / Into / Out

Step through code during debugging

Step Over: F10 Step Into: F11 Step Out: Shift+F11

Toggle Breakpoint

Add or remove a breakpoint on current line

Mac/Win: F9

Common Patterns

Multi-Cursor Editing Workflow

Rename multiple occurrences of a variable efficiently

1. Place cursor on the variable name
2. Press Cmd+D (Mac) / Ctrl+D (Win) to select next match
3. Keep pressing Cmd+D to add more matches
4. Type the new name — all selections update simultaneously

Tip: Press Cmd+K then Cmd+D to skip a match
     Press Escape to exit multi-cursor mode

Refactoring with F2

Rename a symbol across all files in the workspace

1. Place cursor on the symbol (variable, function, class)
2. Press F2 to open the rename input
3. Type the new name
4. Press Enter — VS Code updates all references across files

This respects TypeScript/JavaScript imports and exports.
Works in most language extensions (Python, Go, etc.)

Quick File Switching

Navigate between recently opened files quickly

Cmd+P (Mac) / Ctrl+P (Win) — Quick Open

- Type a filename fragment to filter: "userhook" -> useUserHook.ts
- Press Enter to open, or Right Arrow to open in split view

Ctrl+Tab — cycle through recently used editor tabs

Ctrl+- (Mac) — navigate back (like browser back button)
Ctrl+Shift+- (Mac) — navigate forward

Tips & Best Practices

Learn Cmd+Shift+P first — you can discover and run any command from there

Customize keybindings via Cmd+K Cmd+S to match your muscle memory from other editors

Use Cmd+D for quick multi-cursor renaming within a file instead of Find & Replace

Use F2 (Rename Symbol) for cross-file refactoring — safer than search and replace

Install the Settings Sync extension or use built-in sync to keep shortcuts consistent across machines