This post aims to provide you with a comprehensive list of keyboard shortcuts for Visual Studio Code that will help you become more efficient at coding with it.
Common Shortcuts
Action |
Windows |
Mac |
New File |
Control + N |
Command + N |
Open File |
Control + O |
Command + O |
Save |
Control + S |
Command + S |
Save As |
Control + Shift + S |
Command + Shift + S |
Save All |
Control + K / S |
Command + K / S |
Close |
Control + F4 |
Command + F4 |
Close All |
Control + K / Control + W |
Command + K / Command + W |
Reopen closed editor |
Control + Shift + T |
Command + Shift + T |
Show Command Palette |
Control + Shift + P, F1 |
Command + Shift + P, F1 |
Quick Open, Go to File |
Control + P |
Command + P |
New Window/Instance |
Control + Shift + N |
Command + Shift + N |
Close Window/Instance |
Control + Shift + W |
Command + Shift + W |
User Settings |
Control + , |
Command + , |
Keyboard Shortcuts |
Control + K / Control + S |
Command + K / Command + S |
Toggle full screen |
F11 |
|
Toggle editor layout (horizontal/vertical) |
Shift + Alt + 0 |
Shift + Option + 0 |
Zoom in/out |
Control + + / – |
Command + + / – |
Toggle Sidebar visibility |
Control + B |
Command + B |
Close editor |
Control + F4 / Control + W |
Command + F4 / Command + W |
Close folder |
Control + K / F |
Command + K / F |
Split editor |
Control + |Command + | |
|
Focus into 1st, 2nd or 3rd editor group |
Control + 1 / 2 / 3 |
Command + 1 / 2 / 3 |
Focus into previous/next editor group |
Control + K / Control + ← / → |
Command + K / Command + ← / Right Arrow |
Code Navigation
Action |
Windows |
Mac |
Show all Symbols |
Control + T |
Command + T |
Go to Line |
Control + G |
Command + G |
Go to File |
Control + P |
Command + P |
Go to Symbol |
Control + Shift + O |
Command + Shift + O |
Show Problems Panel |
Control + Shift + M |
Command + Shift + M |
Go to Next Error or Warning |
F8 |
|
Go to Previous Error or Warning |
Shift + F8 |
|
Code Editing
Action |
Windows |
Mac |
Cut Line (empty selection) |
Control + X |
Command + X |
Copy Line (empty selection) |
Control + C |
Command + C |
Move Line Up/Down |
Alt + ↑ / ↓ |
Option + ↑ / ↓ |
Copy Line Up/Down |
Shift + Alt + ↑ / ↓ |
Shift + Option + ↑ / ↓ |
Delete Line |
Control + Shift + K |
Command + Shift + K |
Insert Line Below |
Control + Enter |
Command + Enter |
Insert Line Above |
Control + Shift + Enter |
Command + Shift + Enter |
Jump to Matching Bracket |
Control + Shift + |Command + Shift + | |
|
Indent/Outdent Line |
Control + ] / [ |
Command + ] / [ |
Go to Beginning/End of Line |
Home / End |
|
Go to Beginning of File |
Control + Home |
Command + Home |
Go to End of File |
Control + End |
Command + End |
Scroll Line Up/Down |
Control + ↑ / ↓ |
Command + ↑ / ↓ |
Scroll Page Up/Down |
Alt + Page Up / Page Down |
Option + Page Up / Page Down |
Fold (Collapse) Region |
Control + Shift + [ |
Command + Shift + [ |
Unfold (Uncollapse) Region |
Control + Shift + ] |
Command + Shift + ] |
Code Debugging
Action |
Windows |
Mac |
Toggle breakpoint |
F9 |
|
Start/Continue |
F5 |
|
Stop |
Shift + F5 |
|
Step into/out |
F11 / Shift + F11 |
|
Step over |
F10 |
|
Show hover |
Control + K / Control + I |
Command + K / Command + I |
Find and Replace
Action |
Windows |
Mac |
Find |
Control + F |
Command + F |
Replace |
Control + H |
Command + H |
Find Next/Previous |
F3 / Shift + F3 |
|
Select All Occurrences of Find Match |
Alt + Enter |
Option + Enter |
Add Selection to Next Find Match |
Control + D |
Command + D |
Move Last Selection to Next Find Match |
Control + K / Control + D |
Command + K / Command + D |
Toggle Case-Sensitive / Regex / Whole Word |
Alt + C / R / W |
Option + C / R / W |
Multi-cursor and Selection
Action |
Windows |
Mac |
Insert Cursor |
Alt + Click |
Option + Click |
Insert Cursor Above / Below |
Control + Alt + ↑ / ↓ |
Command + Option + ↑ / ↓ |
Undo Last Cursor Operation |
Control + U |
Command + U |
Insert Cursor at End of Each Line Selected |
Shift + Alt + I |
Shift + Option + I |
Select Current Line |
Control + L |
Command + L |
Select All Occurrences of Current Selection |
Control + Shift + L |
Command + Shift + L |
Select All Occurrences of Current Word |
Control + F2 |
Command + F2 |
Expand Selection |
Shift + Alt + → |
Shift + Option + → |
Shrink Selection |
Shift + Alt + ← |
Shift + Option + ← |
Rich Languages Editing
Action |
Windows |
Mac |
Trigger suggestion |
Control + Space / Control + I |
Command + Space / Command + I |
Trigger parameter hints |
Control + Shift + Space |
Command + Shift + Space |
Format document |
Shift + Alt + F |
Shift + Option + F |
Format selection |
Control + K / Control + F |
Command + K / Command + F |
Go to Definition |
F12 |
|
Peek Definition |
Alt + F12 |
Option + F12 |
Open Definition to the side |
Control + K / F12 |
Command + K / F12 |
Quick Fix |
Control + . |
Command + . |
Show References |
Shift + F12 |
|
Rename Symbol |
F2 |
|
Integrated Terminal
Action |
Windows |
Mac |
Show integrated terminal |
Control + ` |
Command + ` |
Create new terminal |
Control + Shift + ` |
Command + Shift + ` |
Copy selection |
Control + C |
Command + C |
Paste into active terminal |
Control + V |
Command + V |
Scroll up/down |
Control + ↑ / ↓ |
Command + ↑ / ↓ |
Scroll Page Up/down |
Shift + Page Up / Page Down |
|
Scroll to top/bottom |
Control + Home / End |
Command + Home / End |
Happy learning!
6 Likes