developer-environment-setup

🚀 VS Code Keyboard Shortcuts Cheat Sheet

A comprehensive guide to essential VS Code keyboard shortcuts for maximum productivity.

📑 Table of Contents


General

Command Windows/Linux macOS
Command Palette Ctrl+Shift+P Cmd+Shift+P
Quick Open File Ctrl+P Cmd+P
New Window Ctrl+Shift+N Cmd+Shift+N
Close Window Ctrl+W Cmd+W
Settings Ctrl+, Cmd+,
Keyboard Shortcuts Ctrl+K Ctrl+S Cmd+K Cmd+S
Toggle Sidebar Ctrl+B Cmd+B
Toggle Panel Ctrl+J Cmd+J
Zen Mode Ctrl+K Z Cmd+K Z

Editing

Command Windows/Linux macOS
Copy Line Down Shift+Alt+Down Shift+Option+Down
Copy Line Up Shift+Alt+Up Shift+Option+Up
Move Line Down Alt+Down Option+Down
Move Line Up Alt+Up Option+Up
Delete Line Ctrl+Shift+K Cmd+Shift+K
Insert Line Above Ctrl+Shift+Enter Cmd+Shift+Enter
Insert Line Below Ctrl+Enter Cmd+Enter
Comment Line Ctrl+/ Cmd+/
Block Comment Shift+Alt+A Shift+Option+A
Format Document Shift+Alt+F Shift+Option+F
Format Selection Ctrl+K Ctrl+F Cmd+K Cmd+F
Undo Ctrl+Z Cmd+Z
Redo Ctrl+Y Cmd+Shift+Z
Select All Ctrl+A Cmd+A
Fold Region Ctrl+Shift+[ Cmd+Option+[
Unfold Region Ctrl+Shift+] Cmd+Option+]
Fold All Ctrl+K Ctrl+0 Cmd+K Cmd+0
Unfold All Ctrl+K Ctrl+J Cmd+K Cmd+J
Command Windows/Linux macOS
Go to Line Ctrl+G Cmd+G
Go to Symbol in File Ctrl+Shift+O Cmd+Shift+O
Go to Symbol in Workspace Ctrl+T Cmd+T
Go to Definition F12 F12
Peek Definition Alt+F12 Option+F12
Go to References Shift+F12 Shift+F12
Go Back Alt+Left Ctrl+-
Go Forward Alt+Right Ctrl+Shift+-
Next Error/Warning F8 F8
Previous Error/Warning Shift+F8 Shift+F8
Switch Editor Tab Ctrl+Tab Ctrl+Tab
Navigate Editor Group Ctrl+1/2/3 Cmd+1/2/3
Close Editor Ctrl+W Cmd+W
Reopen Closed Editor Ctrl+Shift+T Cmd+Shift+T

Search and Replace

Command Windows/Linux macOS
Find Ctrl+F Cmd+F
Replace Ctrl+H Cmd+Option+F
Find Next F3 Cmd+G
Find Previous Shift+F3 Cmd+Shift+G
Find in Files Ctrl+Shift+F Cmd+Shift+F
Replace in Files Ctrl+Shift+H Cmd+Shift+H
Toggle Case Sensitive Alt+C Cmd+Option+C
Toggle Whole Word Alt+W Cmd+Option+W
Toggle Regex Alt+R Cmd+Option+R

Multi-Cursor

Command Windows/Linux macOS
Add Cursor Above Ctrl+Alt+Up Cmd+Option+Up
Add Cursor Below Ctrl+Alt+Down Cmd+Option+Down
Add Cursor to Line Ends Shift+Alt+I Shift+Option+I
Select All Occurrences Ctrl+Shift+L Cmd+Shift+L
Select Next Occurrence Ctrl+D Cmd+D
Skip Occurrence Ctrl+K Ctrl+D Cmd+K Cmd+D
Column Selection Shift+Alt+Drag Shift+Option+Drag
Undo Cursor Ctrl+U Cmd+U

Terminal

Command Windows/Linux macOS
Toggle Terminal Ctrl+` Cmd+`
New Terminal Ctrl+Shift+` Cmd+Shift+`
Kill Terminal Ctrl+Shift+K Cmd+Shift+K
Split Terminal Ctrl+Shift+5 Cmd+Shift+5
Navigate Terminals Alt+Down/Up Cmd+Down/Up
Clear Terminal Ctrl+K Cmd+K
Scroll Up Ctrl+Up Cmd+Up
Scroll Down Ctrl+Down Cmd+Down

Debugging

Command Windows/Linux macOS
Start/Continue F5 F5
Stop Shift+F5 Shift+F5
Restart Ctrl+Shift+F5 Cmd+Shift+F5
Step Over F10 F10
Step Into F11 F11
Step Out Shift+F11 Shift+F11
Toggle Breakpoint F9 F9
Show Hover Ctrl+K Ctrl+I Cmd+K Cmd+I

Git

Command Windows/Linux macOS
Open Source Control Ctrl+Shift+G Cmd+Shift+G
Git: Commit Ctrl+Enter Cmd+Enter
Git: Pull Ctrl+Shift+P → Pull Cmd+Shift+P → Pull
Git: Push Ctrl+Shift+P → Push Cmd+Shift+P → Push
Show Git Graph Ctrl+Shift+G G Cmd+Shift+G G

File Management

Command Windows/Linux macOS
New File Ctrl+N Cmd+N
Open File Ctrl+O Cmd+O
Save Ctrl+S Cmd+S
Save As Ctrl+Shift+S Cmd+Shift+S
Save All Ctrl+K S Cmd+K S
Close File Ctrl+W Cmd+W
Close All Ctrl+K Ctrl+W Cmd+K Cmd+W
Reopen Closed Ctrl+Shift+T Cmd+Shift+T
Copy Path Ctrl+K P Cmd+K P
Reveal in Explorer Ctrl+K R Cmd+K R

Display

Command Windows/Linux macOS
Zoom In Ctrl+= Cmd+=
Zoom Out Ctrl+- Cmd+-
Reset Zoom Ctrl+0 Cmd+0
Toggle Full Screen F11 Ctrl+Cmd+F
Split Editor Ctrl+\ Cmd+\
Focus Into 1st Group Ctrl+1 Cmd+1
Focus Into 2nd Group Ctrl+2 Cmd+2
Focus Into 3rd Group Ctrl+3 Cmd+3

Extensions

Command Windows/Linux macOS
Show Extensions Ctrl+Shift+X Cmd+Shift+X
Install Extension Ctrl+Shift+P → Install Cmd+Shift+P → Install

Emmet

Command Windows/Linux macOS
Expand Abbreviation Tab Tab
Wrap with Abbreviation Ctrl+Shift+P → Wrap Cmd+Shift+P → Wrap

Custom Snippets

Command Windows/Linux macOS
Insert Snippet Ctrl+Shift+P → Insert Cmd+Shift+P → Insert
Configure Snippets Ctrl+Shift+P → Snippets Cmd+Shift+P → Snippets

💡 Pro Tips

  1. Command Palette: Learn to use Ctrl+Shift+P / Cmd+Shift+P - it gives you access to ALL commands
  2. Quick Open: Use Ctrl+P / Cmd+P to quickly open files by typing part of their name
  3. Multi-Cursor: Select text, then press Ctrl+D / Cmd+D repeatedly to select next occurrences
  4. Zen Mode: Focus on code with Ctrl+K Z / Cmd+K Z to hide all UI
  5. Split Editor: Work on multiple files side-by-side with Ctrl+\ / Cmd+\
  6. Git Integration: Use Ctrl+Shift+G / Cmd+Shift+G for quick git operations
  7. IntelliSense: Ctrl+Space / Cmd+Space triggers suggestions anywhere
  8. Format on Save: Enable in settings for automatic formatting

🔧 Customize Your Shortcuts

  1. Open Keyboard Shortcuts: Ctrl+K Ctrl+S / Cmd+K Cmd+S
  2. Search for the command you want to change
  3. Click the pencil icon and press your desired key combination
  4. Save and enjoy your custom workflow!

📚 Learn More


Happy Coding! 🎉