Back to Blog

VS Code Shortcuts

Jan 22, 2022 Updated: Jan 22, 2022

General

KeyAction
Ctrl + Shift + P, F1Show Command Palette
Ctrl + PQuick Open, Go to File
Ctrl + Shift + NNew window / instance
Ctrl + ,User settings
Ctrl + K Ctrl + SKeyboard Shortcuts

Basic Editing

KeyAction
Ctrl + XCut line (empty selection)
Ctrl + CCopy line (empty selection)
Alt + up / downMove line up / down
Shift + Alt + up / downCopy line up / down
Ctrl + Shift + KDelete line
Ctrl + EnterInsert line below
Ctrl + Shift + EnterInsert line above
Ctrl + Shift + \Jump to matching bracket
Ctrl + ] / [Indent / outdent line
Home + EndGo to beginning / end of line
Ctrl + HomeGo to beginning of line
Ctrl + EndGo to end of line
Ctrl + up / downScroll line up / down
Alt + PgUp / PgDnScroll page up / down
Ctrl + Shift + [Fold (collapse) region
Ctrl + Shift + ]Unfold (uncollapse) region
Ctrl + K Ctrl + [Fold (collapse) all subregions
Ctrl + K Ctrl + ]Unfold (uncollapse) all subregions
Ctrl + K Ctrl + 0Fold (collapse) all regions
Ctrl + K Ctrl + JUnfold (uncollapse) all regions
Ctrl + K Ctrl + CAdd line comment
Ctrl + K Ctrl + URemove line comment
Ctrl + /Toggle line comment
Shift + Alt + AToggle block comment
Alt + ZToggle word wrap
KeyAction
Ctrl + TShow all Symbols
Ctrl + GGo to line
Ctrl + PGo to file
Ctrl + Shift + OGo to symbol
Ctrl + Shift + MShow problems panel
F8Go to next error or warning
Shift + F8Go to previous error or warning
Ctrl + Shift + TabNavigate editor group history
Alt + left / rightGo back / forward

Search and replace

KeyAction
Ctrl + FFind
Ctrl + FFind
Ctrl + HReplace
F3 / Shift + F3Find next/previous
Alt + EnterSelect all occurences of Find match
Ctrl + DAdd selection to next Find match
Ctrl + USkip current selection of Find match
Ctrl + K Ctrl + DMove last selection to next Find match
Alt + C / R / WToggle case-sensitive / regex / whole word

Multi-cursor and selection

KeyAction
Alt + clickInsert cursor
Ctrl + Alt + up / downInsert cursor above / below
Ctrl + UUndo last cursor operation
Shift + Alt + IInsert cursor at end of each line selected
Ctrl + LSelect current line
Ctrl + Shift + LSelect all occurences of current selection
Ctrl + F2Select all occurences of current word
Shift + Alt + rightExpand selection
Shift + Alt + leftShrink selection
Shift + Alt + drag mouseColumn (box) selection
Ctrl + Shift + Alt + arrow keyColumn (box) selection
Ctrl + Shift + Alt + PgUp / PgDnColumn (box) selection page up / down

Rich languages editing

KeyAction
Ctrl + Space, Ctrl + ITrigger suggestion
Ctrl + Shift + SpaceTrigger parameter hints
Alt + Shift + FFormat document
Ctrl + K Ctrl + FFormat selection
F12Go to definition
Alt + F12Peek definition
Ctrl + K F12Open definition to the side
Ctrl + .Quick fix
Shift + F12Show references
F2Rename symbol
Ctrl + K Ctrl + XTrim trailing whitespace
Ctrl + K MChange file language

Editor management

KeyAction
Ctrl + F4, Ctrl + WClose editor
Ctrl + K FClose folder
Ctrl + \Split editor
Ctrl + 1 / 2 / 3Focus into 1st, 2nd or 3rd editor group
Ctrl + K Ctrl + left / rightFocus into previours / next editor group
Ctrl + Shift + PgUp / PgDnMove editor left / right
Ctrl + K left / rightMove active editor group

File management

KeyAction
Ctrl + NNew File
Ctrl + OOpen File
Ctrl + SSave
Ctrl + Shift + SSave As
Ctrl + K SSave All
Ctrl + F4Close
Ctrl + K Ctrl + WClose All
Ctrl + Shift + TReopen closed editor
Ctrl + K EnterKeep preview mode editor open
Ctrl + TabOpen next
Ctrl + Shift + TabOpen previous
Ctrl + K PCopy path of active file
Ctrl + K RReveal active file in Explorer
Ctrl + K OShow active file in new window / instance

Display

KeyAction
F11Toggle full screen
Alt + Shift + 0Toggle editor layout (horizontal / vertical)
Ctrl + = / -Zoom in / out
Ctrl + BToogle sidebar visibility
Ctrl + Shift + EShow Explorer / Toogle focus
Ctrl + Shift + FShow Search
Ctrl + Shift + GShow Source Control
Ctrl + Shift + DShow Debug
Ctrl + Shift + XShow Extensions
Ctrl + Shift + HReplace in files
Ctrl + Shift + JToggle Search details
Ctrl + Shift + UShow Output panel
Ctrl + Shift + VOpen Markdown preview
Ctrl + K VOpen Markdown preview to the side
Ctrl + K ZZen mode (Esc to exit)

Debug

KeyAction
F9Toogle breakpoint
F5Start / Continue
Shift + F5Stop
F11 / Shift + F11Step into / out
F10Step over
Ctrl + K Ctrl + IShow hover

Integrated terminal

KeyAction
Ctrl + `Show integrated terminal
Ctrl + Shift + `Create new terminal
Ctrl + CCopy selection
Ctrl + VPaste into active terminal
Ctrl + up / downScroll up / down
Shift + PgUp / PgDnScroll page up / down
Ctrl + Home / EndScroll to top / bottom

Source Windows: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf

Source Mac: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf

Contact

Got A Question For Me?

Feel free to ask anything directly on call or fill the form and I will contact back within few hours.