This cheat sheet covers the essential Visual Studio Code shortcuts for both Windows and Mac. Improve your workflow by mastering these commands!
No. | Windows Shortcut | Mac Shortcut | Description |
---|---|---|---|
1 | Ctrl + C |
Cmd + C |
Copy selected text or item |
2 | Ctrl + X |
Cmd + X |
Cut selected text or item |
3 | Ctrl + V |
Cmd + V |
Paste from clipboard |
4 | Ctrl + Z |
Cmd + Z |
Undo last action |
5 | Ctrl + Y |
Cmd + Shift + Z |
Redo last undone action |
6 | Ctrl + A |
Cmd + A |
Select all content |
No. | Windows Shortcut | Mac Shortcut | Description |
---|---|---|---|
7 | Ctrl + P |
Cmd + P |
Quick open files |
8 | Ctrl + Shift + P |
Cmd + Shift + P |
Open command palette |
9 | Ctrl + K, Ctrl + S |
Cmd + K, Cmd + S |
Open keyboard shortcuts settings |
10 | Ctrl + F |
Cmd + F |
Find in current file |
11 | Ctrl + H |
Cmd + Option + F |
Find and replace in current file |
12 | Ctrl + D |
Cmd + D |
Select next occurrence of selected text |
No. | Windows Shortcut | Mac Shortcut | Description |
---|---|---|---|
13 | Alt + Up Arrow |
Option + Up Arrow |
Move line up |
14 | Alt + Down Arrow |
Option + Down Arrow |
Move line down |
15 | Ctrl + Shift + K |
Cmd + Shift + K |
Delete line |
16 | Ctrl + Enter |
Cmd + Enter |
Insert a new line below |
17 | Ctrl + Shift + Enter |
Cmd + Shift + Enter |
Insert a new line above |
18 | Ctrl + Shift + L |
Cmd + Shift + L |
Select all occurrences of current selection |
19 | Ctrl + / |
Cmd + / |
Toggle line comment |
20 | Ctrl + Shift + / |
Cmd + Option + / |
Toggle block comment |
No. | Windows Shortcut | Mac Shortcut | Description |
---|---|---|---|
21 | Ctrl + B |
Cmd + B |
Toggle sidebar visibility |
22 | Ctrl + Shift + E |
Cmd + Shift + E |
Focus on Explorer view |
23 | Ctrl + Shift + G |
Cmd + Shift + G |
Focus on Source Control view |
24 | Ctrl + Shift + D |
Cmd + Shift + D |
Focus on Debug view |
25 | Ctrl + Shift + X |
Cmd + Shift + X |
Focus on Extensions view |
No. | Windows Shortcut | Mac Shortcut | Description |
---|---|---|---|
26 | Alt + Shift + F |
Option + Shift + F |
Format document |
27 | Ctrl + Shift + M |
Cmd + Shift + M |
Show problems panel |
28 | `Ctrl + `` | `Cmd + `` | Toggle integrated terminal |
No. | Windows Shortcut | Mac Shortcut | Description |
---|---|---|---|
29 | Ctrl + Shift + Tab |
Cmd + Shift + Tab |
Navigate backward through open files |
30 | Ctrl + Tab |
Cmd + Tab |
Navigate forward through open files |
31 | Ctrl + K, Ctrl + 0 |
Cmd + K, Cmd + 0 |
Collapse all code regions |
32 | Ctrl + K, Ctrl + J |
Cmd + K, Cmd + J |
Expand all code regions |
33 | Shift + Alt + Down |
Option + Shift + Down |
Copy line down |
34 | Shift + Alt + Up |
Option + Shift + Up |
Copy line up |
35 | Ctrl + Shift + N |
Cmd + Shift + N |
Open a new window |
36 | Ctrl + K, Z |
Cmd + K, Z |
Enter Zen mode (distraction-free mode) |
37 | Ctrl + K, Ctrl + W |
Cmd + K, Cmd + W |
Close all editors |
38 | Ctrl + W |
Cmd + W |
Close the current editor |
No. | Windows Shortcut | Mac Shortcut | Description |
---|---|---|---|
39 | Ctrl + K, Ctrl + F |
Cmd + K, Cmd + F |
Format selection |
40 | Ctrl + Shift + U |
Cmd + Shift + U |
Show output panel |
41 | Ctrl + F2 |
Cmd + F2 |
Select all occurrences of word |
42 | Ctrl + K, Ctrl + C |
Cmd + K, Cmd + C |
Add line comment |
43 | Ctrl + K, Ctrl + U |
Cmd + K, Cmd + U |
Remove line comment |
44 | Ctrl + K, O |
Cmd + K, O |
Open file in new window |
No. | Windows Shortcut | Mac Shortcut | Description |
---|---|---|---|
45 | Ctrl + / |
Cmd + / |
Comments for code documents |
46 | Alt + L , Alt + O |
Cmd + L , Cmd + O |
Run the code (live server) |
- Select the shortcut from the table based on your operating system.
- Copy the command and start boosting your productivity in VS Code!