In Visual Studio Code, you can perform many operations directly from the keyboard. This is a collection of useful shortcuts. It does not cover every shortcut.
General shortcuts that are not tied to a specific file type. Much of this information comes from Key Bindings for Visual Studio Code.
Operation | Key(s) |
---|---|
Cut | Ctrl + X |
Copy | Ctrl + C |
Paste | Ctrl + V |
Move Line Down | Alt + Down |
Move Line Up | Alt + Up |
Copy Line Down | Shift + Alt + Down |
Copy Line Up | Shift + Alt + Up |
Undo | Ctrl + Z |
Redo | Ctrl + Y |
Undo last cursor operation | Ctrl + U |
Insert cursor at end of each line selected | Shift + Alt + I |
Select current line | Ctrl + L |
Insert Cursor Below | Ctrl + Alt + Down |
Insert Cursor Above | Ctrl + Alt + Up |
Go to Beginning of Line | Home |
Go to End of Line | End |
Go to Beginning of File | Ctrl + Home |
Go to End of File | Ctrl + End |
Scroll Line Down | Ctrl + Down |
Scroll Line Up | Ctrl + Up |
Scroll Page Down | Ctrl + Page Down |
Scroll Page Up | Ctrl + Page Up |
All Line Comment | Ctrl + K and Ctrl + C |
Remove Line Comment | Ctrl + K and Ctrl + U |
Toggle Word Wrap | Alt + Z |
Operation | Key(s) |
---|---|
Format Document | Shift + Alt + F |
Format Selection | Ctrl + K and Ctrl + F |
Go to Definition | F12 |
Peek Definition | Alt + F12 |
Open Definition to the Side | Ctrl + K and F12 |
Go to References | Shift + F12 |
Rename Symbol | F2 |
Operation | Key(s) |
---|---|
Show All Symbols | Ctrl + T |
Go to Line... | Ctrl + G |
Go to File... | Ctrl + P |
Go to Symbol... | Ctrl + Shift + O |
Show All Commands | Ctrl + Shift + P or F1 |
Go Back | Alt + Left |
Go Forward | Alt + Right |
Operation | Key(s) |
---|---|
New Window | Ctrl + Shift + N |
Close Window | Alt + F4 |
Close Editor | Ctrl + W |
Split Editor | Ctrl + \ (Ctrl + | ) |
Operation | Key(s) |
---|---|
New File | Ctrl + N |
Open File... | Ctrl + O |
Save | Ctrl + S |
Save All | Ctrl + K and S |
Save As | Ctrl + Shift + S |
Close | Ctrl + W |
Close Group | Ctrl + K and W |
Close All | Ctrl + K and Ctrl + W |
Show Opened File in New Window | Ctrl + K and O |
Operation | Key(s) |
---|---|
Toggle Full Screen | F11 |
Toggle Zen Mode | Ctrl + K and Z |
Leave Zen Mode | Esc and Esc |
Zoom in | Ctrl + = (Ctrl + + ) |
Zoom out | Ctrl + - |
Reset Zoom | Ctrl + Numpad0 |
Open New Command Prompt | Ctrl + Shift + C |
Open Preview to the Side | Ctrk + K and V |
Toggle Terminal | Ctrl + ` (Ctrl + Ø ) |
Operation | Key(s) |
---|---|
Find | Ctrl + F |
Find in Files | Ctrl + Shift + F |
Replace | Ctrl + H |
Replace in Files | Ctrl + Shift + H |
Find Next | Enter |
Find Previous | Shift + Enter |
Find All References | Shift + Alt + F12 |
Show Call Hierarchy | Shift + Alt + H |
Operation | Key(s) |
---|---|
Open Settings | Ctrl + , |
Open Keyboard Shortcuts | Ctrl + K and Ctrl + S |
Select Colour Theme | Ctrl + K and Ctrl + T |
Operation | Key(s) |
---|---|
Toggle Breakpoint | F9 |
Start | F5 |
Continue | F5 |
Start (without debugging) | Ctrl + F5 |
Pause | F6 |
Step Into | F11 |
These shortcuts require Microsoft's C/C++ extension for Visual Studio Code.
Operation | Key(s) |
---|---|
Switch Header/Source | Alt + O |