VS Code Shortcuts Cheatsheet
Essential keyboard shortcuts for Visual Studio Code on Windows and Mac
Essential Editing
Basic Editing
Most commonly used editing shortcuts
// Windows: Ctrl + S Mac: ⌘ + S
// Save file
// Windows: Ctrl + X Mac: ⌘ + X
// Cut line/selection
// Windows: Ctrl + C Mac: ⌘ + C
// Copy line/selection
// Windows: Ctrl + V Mac: ⌘ + V
// Paste
// Windows: Ctrl + Z Mac: ⌘ + Z
// Undo
// Windows: Ctrl + Shift + Z Mac: ⌘ + ⇧ + Z
// Redo
// Windows: Alt + ↑/↓ Mac: ⌥ + ↑/↓
// Move line up/down
// Windows: Ctrl + / Mac: ⌘ + /
// Toggle line comment
Text Selection
Smart selection shortcuts
// Windows: Ctrl + A Mac: ⌘ + A
// Select all
// Windows: Ctrl + L Mac: ⌘ + L
// Select current line
// Windows: Ctrl + D Mac: ⌘ + D
// Select next occurrence
// Windows: Ctrl + Shift + L Mac: ⌘ + ⇧ + L
// Select all occurrences
// Windows: Alt + Click Mac: ⌥ + Click
// Insert cursor
// Windows: Shift + Alt + Drag Mac: ⇧ + ⌥ + Drag
// Column selection
// Windows: Ctrl + Shift + → Mac: ⌘ + ⇧ + →
// Select word
// Windows: Ctrl + U Mac: ⌘ + U
// Undo last cursor operation
Navigation & Search
Quick Navigation
Fast file and symbol navigation
// Windows: Ctrl + P Mac: ⌘ + P
// Quick file open
// Windows: Ctrl + G Mac: ⌘ + G
// Go to line
// Windows: Ctrl + T Mac: ⌘ + T
// Show all symbols
// Windows: Ctrl + Shift + O Mac: ⌘ + ⇧ + O
// Go to symbol
// Windows: Alt + ←/→ Mac: ⌥ + ←/→
// Go back/forward
// Windows: Ctrl + Shift + Tab Mac: ⌘ + ⇧ + Tab
// Navigate editor tabs
// Windows: Ctrl + ` Mac: ⌘ + `
// Toggle terminal
// Windows: Ctrl + B Mac: ⌘ + B
// Toggle sidebar
Search & Replace
Find and replace functionality
// Windows: Ctrl + F Mac: ⌘ + F
// Find
// Windows: Ctrl + H Mac: ⌘ + H
// Replace
// Windows: Ctrl + Shift + F Mac: ⌘ + ⇧ + F
// Find in files
// Windows: Ctrl + Shift + H Mac: ⌘ + ⇧ + H
// Replace in files
// Windows: F3 / Shift + F3 Mac: ⌘ + G / ⌘ + ⇧ + G
// Find next/previous
// Windows: Alt + Enter Mac: ⌥ + Enter
// Select all occurrences to replace
Code Editing & IntelliSense
Code Actions
Smart coding assistance
// Windows: Ctrl + Space Mac: ⌘ + Space
// Trigger suggestion
// Windows: Ctrl + . Mac: ⌘ + .
// Quick fix
// Windows: F12 Mac: F12
// Go to definition
// Windows: Alt + F12 Mac: ⌥ + F12
// Peek definition
// Windows: Shift + F12 Mac: ⇧ + F12
// Show references
// Windows: Ctrl + K Ctrl + F Mac: ⌘ + K ⌘ + F
// Format selection
// Windows: Shift + Alt + F Mac: ⇧ + ⌥ + F
// Format document
// Windows: F2 Mac: F2
// Rename symbol
Code Folding
Collapse and expand code
// Windows: Ctrl + Shift + [ Mac: ⌘ + ⌥ + [
// Fold region
// Windows: Ctrl + Shift + ] Mac: ⌘ + ⌥ + ]
// Unfold region
// Windows: Ctrl + K Ctrl + 0 Mac: ⌘ + K ⌘ + 0
// Fold all
// Windows: Ctrl + K Ctrl + J Mac: ⌘ + K ⌘ + J
// Unfold all
// Windows: Ctrl + K Ctrl + [ Mac: ⌘ + K ⌘ + [
// Fold recursively
// Windows: Ctrl + K Ctrl + ] Mac: ⌘ + K ⌘ + ]
// Unfold recursively
Integrated Tools
Terminal & Debug
Terminal and debugging shortcuts
// Windows: Ctrl + ` Mac: ⌘ + `
// Toggle terminal
// Windows: Ctrl + Shift + ` Mac: ⌘ + ⇧ + `
// New terminal
// Windows: F5 Mac: F5
// Start/Continue debugging
// Windows: Shift + F5 Mac: ⇧ + F5
// Stop debugging
// Windows: F9 Mac: F9
// Toggle breakpoint
// Windows: F10 Mac: F10
// Step over
// Windows: F11 Mac: F11
// Step into
// Windows: Shift + F11 Mac: ⇧ + F11
// Step out
Git Integration
Source control shortcuts
// Windows: Ctrl + Shift + G Mac: ⌘ + ⇧ + G
// Open source control
// Windows: Ctrl + Enter Mac: ⌘ + Enter
// Stage changes
// Windows: Ctrl + Shift + P Mac: ⌘ + ⇧ + P
// Then type 'git' for more Git commands
// Common Git Commands:
// - Commit
// - Push
// - Pull
// - Checkout to
// - Create branch
// - Merge branch