VS Code keyboard shortcuts
The Visual Studio Code shortcuts that pay off every day, with the default keys. Switch between Windows and Mac above.
⌘ Command⌥ Option⇧ Shift⌃ Control
Nothing matches your search.
Essentials
- CtrlShiftP⌘⇧P
- Command Palette: run any command
- CtrlP⌘P
- Quick Open: go to a file by name
- Ctrl,⌘,
- Open settings
- CtrlKthenCtrlS⌘Kthen⌘S
- Open keyboard shortcuts
- CtrlB⌘B
- Show or hide the sidebar
- CtrlJ⌘J
- Show or hide the bottom panel
- CtrlKthenZ⌘KthenZ
- Zen mode (Esc twice to leave)
Editing lines
- CtrlX⌘X
- Cut the line (when nothing is selected)
- CtrlShiftK⌘⇧K
- Delete the line
- Alt↑⌥↑
- Move the line up (Down to move it down)
- ShiftAlt↓⇧⌥↓
- Copy the line below (Up to copy above)
- CtrlEnter⌘return
- Insert a line below
- CtrlShiftEnter⌘⇧return
- Insert a line above
- Ctrl/⌘/
- Comment or uncomment the line
- ShiftAltA⇧⌥A
- Toggle a block comment
- Ctrl]⌘]
- Indent the line (Ctrl/Cmd+[ to outdent)
- ShiftAltF⇧⌥F
- Format the document
- AltZ⌥Z
- Turn word wrap on or off
Multiple cursors and selection
- AltClick⌥Click
- Add a cursor where you click
- CtrlAlt↓⌘⌥↓
- Add a cursor below (Up for above)
- CtrlD⌘D
- Select the next match of the selection
- CtrlShiftL⌘⇧L
- Select every match of the selection
- CtrlL⌘L
- Select the line
- ShiftAlt→⌃⇧⌘→
- Expand the selection step by step
- ShiftAltDrag⇧⌥Drag
- Select a column (box selection)
Navigation
- CtrlG⌃G
- Go to a line number
- CtrlShiftO⌘⇧O
- Go to a symbol in the file
- F12F12
- Go to definition
- AltF12⌥F12
- Peek the definition inline
- Alt←⌃-
- Go back to where you were
- Alt→⌃⇧-
- Go forward
- CtrlTab⌃tab
- Switch between open files
- CtrlShift\⌘⇧\
- Jump to the matching bracket
- F8F8
- Go to the next error or warning
Search and replace
- CtrlF⌘F
- Find in the file
- CtrlH⌘⌥F
- Replace in the file
- CtrlShiftF⌘⇧F
- Search in all files
- CtrlShiftH⌘⇧H
- Replace in all files
- F2F2
- 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⌘W
- Close the file
- CtrlShiftE⌘⇧E
- Show the file Explorer
- CtrlShiftG⌃⇧G
- Show Source Control (Git)
- CtrlShiftX⌘⇧X
- Show Extensions
- CtrlShiftM⌘⇧M
- Show Problems
Keys are the defaults; extensions or your own settings can change them.

