VS Code Keyboard Shortcuts

A deep, practical VS Code shortcuts guide for navigation, editing, refactor, debugging, and Git. Split by Mac and Windows/Linux for quick lookup.

VS Code Keyboard Shortcuts banner

Core Navigation (Mac)

Key / CodeDescription
Cmd + PQuick Open (files)
Cmd + Shift + PCommand Palette
Cmd + TGo to symbol in workspace
Ctrl + TabNext editor tab
Cmd + BToggle Sidebar
Cmd + JToggle Panel
Cmd + K, ZToggle Zen Mode

Core Navigation (Windows/Linux)

Key / CodeDescription
Ctrl + PQuick Open (files)
Ctrl + Shift + PCommand Palette
Ctrl + TGo to symbol in workspace
Ctrl + TabNext editor tab
Ctrl + BToggle Sidebar
Ctrl + JToggle Panel
Ctrl + K, ZToggle Zen Mode

Editing & Multi-cursor (Mac)

Key / CodeDescription
Option + ClickInsert cursor
Cmd + DSelect next occurrence
Cmd + Shift + LSelect all occurrences
Cmd + UUndo last cursor
Option + Up/DownMove line
Shift + Option + Up/DownDuplicate line
Cmd + /Toggle line comment
Shift + Option + AToggle block comment

Editing & Multi-cursor (Windows/Linux)

Key / CodeDescription
Alt + ClickInsert cursor
Ctrl + DSelect next occurrence
Ctrl + Shift + LSelect all occurrences
Ctrl + UUndo last cursor
Alt + Up/DownMove line
Shift + Alt + Up/DownDuplicate line
Ctrl + /Toggle line comment
Shift + Alt + AToggle block comment

Search & Replace (Mac)

Key / CodeDescription
Cmd + FFind in file
Cmd + Option + FReplace in file
Cmd + Shift + FFind in workspace
Cmd + Shift + HReplace in workspace
F12Go to definition
Shift + F12Go to references
Cmd + .Quick Fix

Search & Replace (Windows/Linux)

Key / CodeDescription
Ctrl + FFind in file
Ctrl + HReplace in file
Ctrl + Shift + FFind in workspace
Ctrl + Shift + HReplace in workspace
F12Go to definition
Shift + F12Go to references
Ctrl + .Quick Fix

Refactor & Format

Key / CodeDescription
Shift + Option + F (Mac)Format document
Shift + Alt + F (Win/Linux)Format document
Cmd + K, Cmd + F (Mac)Format selection
Ctrl + K, Ctrl + F (Win/Linux)Format selection
F2Rename symbol
Cmd/Ctrl + .Code actions

Debugging

Key / CodeDescription
F5Start/Continue
Shift + F5Stop
F9Toggle breakpoint
F10Step over
F11Step into
Shift + F11Step out

Git & Source Control

Key / CodeDescription
Cmd/Ctrl + Shift + GOpen Source Control
Cmd/Ctrl + EnterCommit (when focus in message)
Cmd/Ctrl + Shift + PGit: commands via palette

Pro Workflow

Build muscle memory with a minimal daily loop: open file, edit with multi-cursor, quick fix, format, commit.

Cmd/Ctrl + P  # open file
Cmd/Ctrl + D  # multi-cursor
Cmd/Ctrl + .  # quick fix
Shift + Alt/Option + F  # format
Cmd/Ctrl + Shift + G  # git
Knowledge is power.