Cheatsheet
← All cheat sheets

VS Code keyboard shortcuts

The Visual Studio Code shortcuts that pay off every day, with the default keys. Switch between Windows and Mac above.

Essentials

CtrlShiftP
Command Palette: run any command
CtrlP
Quick Open: go to a file by name
Ctrl,
Open settings
CtrlKthenCtrlS
Open keyboard shortcuts
CtrlB
Show or hide the sidebar
CtrlJ
Show or hide the bottom panel
CtrlKthenZ
Zen mode (Esc twice to leave)

Editing lines

CtrlX
Cut the line (when nothing is selected)
CtrlShiftK
Delete the line
Alt↑
Move the line up (Down to move it down)
ShiftAlt↓
Copy the line below (Up to copy above)
CtrlEnter
Insert a line below
CtrlShiftEnter
Insert a line above
Ctrl/
Comment or uncomment the line
ShiftAltA
Toggle a block comment
Ctrl]
Indent the line (Ctrl/Cmd+[ to outdent)
ShiftAltF
Format the document
AltZ
Turn word wrap on or off

Multiple cursors and selection

AltClick
Add a cursor where you click
CtrlAlt↓
Add a cursor below (Up for above)
CtrlD
Select the next match of the selection
CtrlShiftL
Select every match of the selection
CtrlL
Select the line
ShiftAlt→
Expand the selection step by step
ShiftAltDrag
Select a column (box selection)

Navigation

CtrlG
Go to a line number
CtrlShiftO
Go to a symbol in the file
F12
Go to definition
AltF12
Peek the definition inline
Alt←
Go back to where you were
Alt→
Go forward
CtrlTab
Switch between open files
CtrlShift\
Jump to the matching bracket
F8
Go to the next error or warning

Search and replace

CtrlF
Find in the file
CtrlH
Replace in the file
CtrlShiftF
Search in all files
CtrlShiftH
Replace in all files
F2
Rename a symbol everywhere it’s used

Files, panels and terminal

Ctrl`
Show or hide the terminal
CtrlShift`
Open a new terminal
Ctrl\
Split the editor
CtrlW
Close the file
CtrlShiftE
Show the file Explorer
CtrlShiftG
Show Source Control (Git)
CtrlShiftX
Show Extensions
CtrlShiftM
Show Problems

Keys are the defaults; extensions or your own settings can change them.

Something not working?

Send feedback

What is it?

The page you’re on, your browser and your screen size are sent along to help us fix it. Never your files or what you typed into the tool.