VSCode Quick Dev Reference

This VSCode (Visual Studio Code) quick reference cheat sheet shows its keyboard shortcuts and commands.

Keyboard shortcuts for Windows

General

Ctrl Shift P β€” Show Command Palette

Ctrl P β€” Quick Open, Go to File...

Ctrl Shift N β€” New window/instance

Ctrl Shift W β€” Close window/instance

Ctrl , β€” User Settings

Ctrl K Ctrl S β€” Keyboard Shortcuts

Basic Editing

Ctrl X β€” Cut line (empty selection)

Ctrl C β€” Copy line (empty selection)

Alt Up/Down β€” Move line up/down

Shift Alt Up/Down β€” Copy line up/down

Ctrl Shift K β€” Delete line

Ctrl Enter β€” Insert line below

Ctrl Shift Enter β€” Insert line above

Ctrl Shift \ β€” Jump to matching bracket

Ctrl ]/[ β€” Indent/outdent line

Home/End β€” Go to beginning/end of line

Ctrl Home β€” Go to beginning of file

Ctrl End β€” Go to end of file

Ctrl Up/Down β€” Scroll line up/down

Alt PgUp/PgDown β€” Scroll 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 0 β€” Fold (collapse) all regions

Ctrl K Ctrl J β€” Unfold (uncollapse) all regions

Ctrl K Ctrl C β€” Add line comment

Ctrl K Ctrl U β€” Remove line comment

Ctrl / β€” Toggle line comment

Shift Alt A β€” Toggle block comment

Alt Z β€” Toggle word wrap

Navigation

Ctrl T β€” Show all Symbols

Ctrl G β€” Go to Line...

Ctrl P β€” Go to File...

Ctrl Shift O β€” Go to Symbol...

Ctrl Shift M β€” Show Problems panel

F8 β€” Go to next error or warning

Shift F8 β€” Go to previous error or warning

Ctrl Shift Tab β€” Navigate editor group history

Alt Left/Right β€” Go back/forward

Ctrl M β€” Toggle Tab moves focus

Search and replace

Ctrl F β€” Find

Ctrl H β€” Replace

F3 β€” Find next

Shift F3 β€” Find previous

Alt Enter β€” Select all occurences of Find match

Ctrl D β€” Add selection to next Find match

Ctrl K Ctrl D β€” Move last selection to next Find match

Alt C/R/W β€” Toggle case-sensitive/regex/whole word

Multi-cursor and selection

Alt Click β€” Insert cursor

Ctrl Alt Up/Down β€” Insert cursor above/below

Ctrl U β€” Undo last cursor operation

Shift Alt I β€” Insert cursor at end of each line selected

Ctrl I β€” Select current line

Ctrl Shift L β€” Select all occurrences of current selection

Ctrl F2 β€” Select all occurrences of current word

Shift Alt Right β€” Expand selection

Shift Alt Left β€” Shrink selection

Shift Alt (drag mouse) β€” Column (box) selection

Ctrl Shift Alt (arrow key) β€” Column (box) selection

Ctrl Shift Alt PgUp/PgDown β€” Column (box) selection page up/down

Rich languages editing

Ctrl Space β€” Trigger suggestion

Ctrl Shift Space β€” Trigger parameter hints

Shift Alt F β€” Format document

Ctrl K Ctrl F β€” Format selection

F12 β€” Go to Definition

Alt F12 β€” Peek Definition

Ctrl K F12 β€” Open Definition to the side

Ctrl . β€” Quick Fix

Shift F12 β€” Show References

F2 β€” Rename Symbol

Ctrl K Ctrl X β€” Trim trailing whitespace

Ctrl K M β€” Change file language

Editor management

Ctrl F4 β€” Close editor

Ctrl W β€” Close editor

Ctrl K F β€” Close folder

Ctrl \ β€” Split editor

Ctrl 1/2/3 β€” Focus into 1st, 2nd, or 3rd editor group

Ctrl K Ctrl Left/Right β€” Focus into previous/next editor group

Ctrl Shift PgUp/PgDown β€” Move editor left/right

Ctrl K Left/Right β€” Move active editor group

File management

Ctrl N β€” New File

Ctrl O β€” Open File...

Ctrl S β€” Save

Ctrl Shift S β€” Save As...

Ctrl K S β€” Save All

Ctrl F4 β€” Close

Ctrl K Ctrl W β€” Close All

Ctrl Shift T β€” Reopen closed editor

Ctrl K Enter β€” Keep preview mode editor open

Ctrl Tab β€” Open next

Ctrl Shift Tab β€” Open previous

Ctrl K P β€” Copy path of active file

Ctrl K R β€” Reveal active file in Explorer

Ctrl K O β€” Show active file in new window/instance

Display

F11 β€” Toggle full screen

Shift Alt 0 β€” Toggle editor layout (horizontal/vertical)

Ctrl =/- β€” Zoom in/out

Ctrl B β€” Toggle Sidebar visibility

Ctrl Shift E β€” Show Explorer/Toggle focus

Ctrl Shift F β€” Show Search

Ctrl Shift G β€” Show Source Control

Ctrl Shift D β€” Show Debug

Ctrl Shift X β€” Show Extensions

Ctrl Shift H β€” Replace in files

Ctrl Shift J β€” Toggle Search details

Ctrl Shift U β€” Show Output panel

Ctrl Shift V β€” Open Markdown preview

Ctrl K V β€” Open Markdown preview to the side

Ctrl K Z β€” Zen Mode (Esc Esc to exit)

Debug

F9 β€” Toggle breakpoint

F5 β€” Start/Continue

Shift F5 β€” Stop

F11 β€” Step into

Shift F11 β€” Step out

F10 β€” Step over

Ctrl K Ctrl I β€” Show hover

Integrated terminal

Ctrl ` β€” Show integrated terminal

Ctrl Shift ` β€” Create new terminal

Ctrl C β€” Copy selection

Ctrl V β€” Paste into active terminal

Ctrl Up/Down β€” Scroll up/down

Shift PgUp/PgDown β€” Scroll page up/down

Ctrl Home/End β€” Scroll to top/bottom

Keyboard shortcuts for MacOS

General

β‡§βŒ˜P, F1 β€” Show Command Palette

⌘P β€” Quick Open, Go to File…

β‡§βŒ˜N β€” New window/instance

⌘W β€” Close window/instance

⌘, β€” User Settings

⌘K ⌘S β€” Keyboard Shortcuts

Basic editing

⌘X β€” Cut line (empty selection)

⌘C β€” Copy line (empty selection)

βŒ₯↓ / βŒ₯↑ β€” Move line down/up

⇧βŒ₯↓ / ⇧βŒ₯↑ β€” Copy line down/up

β‡§βŒ˜K β€” Delete line

⌘Enter / β‡§βŒ˜Enter β€” Insert line below/above

β‡§βŒ˜\ β€” Jump to matching bracket

⌘] / ⌘[ β€” Indent/outdent line

Home / End β€” Go to beginning/end of line

βŒ˜β†‘ / βŒ˜β†“ β€” Go to beginning/end of file

βŒƒPgUp / βŒƒPgDn β€” Scroll line up/down

⌘PgUp /⌘PgDn β€” Scroll page up/down

βŒ₯⌘[ / βŒ₯⌘] β€” Fold/unfold region

⌘K ⌘[ / ⌘K ⌘] β€” Fold/unfold all subregions

⌘K ⌘0 / ⌘K ⌘J β€” Fold/unfold all regions

⌘K ⌘C β€” Add line comment

⌘K ⌘U β€” Remove line comment

⌘/ β€” Toggle line comment

⇧βŒ₯A β€” Toggle block comment

βŒ₯Z β€” Toggle word wrap

Multi-cursor and selection

βŒ₯ + β€” click Insert cursor

βŒ₯βŒ˜β†‘ β€” Insert cursor above

βŒ₯βŒ˜β†“ β€” Insert cursor below

⌘U β€” Undo last cursor operation

⇧βŒ₯I β€” Insert cursor at end of each line selected

⌘L β€” Select current line

β‡§βŒ˜L β€” Select all occurrences of current selection

⌘F2 β€” Select all occurrences of current word

βŒƒβ‡§βŒ˜β†’ / ← β€” Expand / shrink selection

⇧βŒ₯ + drag mouse β€” Column (box) selection

⇧βŒ₯βŒ˜β†‘ / ↓ β€” Column (box) selection up/down

⇧βŒ₯βŒ˜β† / β†’ β€” Column (box) selection left/right

⇧βŒ₯⌘PgUp β€” Column (box) selection page up

⇧βŒ₯⌘PgDn β€” Column (box) selection page down

Search and replace

⌘F β€” Find

βŒ₯⌘F β€” Replace

⌘G / β‡§βŒ˜G β€” Find next/previous

βŒ₯Enter β€” Select all occurrences of Find match

⌘D β€” Add selection to next Find match

⌘K ⌘D β€” Move last selection to next Find match

Rich languages editing

βŒƒSpace, ⌘I β€” Trigger suggestion

β‡§βŒ˜Space β€” Trigger parameter hints

⇧βŒ₯F β€” Format document

⌘K ⌘F β€” Format selection

F12 β€” Go to Definition

βŒ₯F12 β€” Peek Definition

⌘K F12 β€” Open Definition to the side

⌘. β€” Quick Fix

⇧F12 β€” Show References

F2 β€” Rename Symbol

⌘K ⌘X β€” Trim trailing whitespace

⌘K M β€” Change file language

Navigation

⌘T β€” Show all Symbols

βŒƒG β€” Go to Line...

⌘P β€” Go to File...

β‡§βŒ˜O β€” Go to Symbol...

β‡§βŒ˜M β€” Show Problems panel

F8 / ⇧F8 β€” Go to next/previous error or warning

βŒƒβ‡§Tab β€” Navigate editor group history

βŒƒ- / βŒƒβ‡§- β€” Go back/forward

βŒƒβ‡§M β€” Toggle Tab moves focus

Editor management

⌘W β€” Close editor

⌘K F β€” Close folder

⌘\ β€” Split editor

⌘1 / ⌘2 / ⌘3 β€” Focus into 1st, 2nd, 3rd editor group

⌘K βŒ˜β† / ⌘K βŒ˜β†’ β€” Focus into previous/next editor group

⌘K β‡§βŒ˜β† / ⌘K β‡§βŒ˜β†’ β€” Move editor left/right

⌘K ← / ⌘K β†’ β€” Move active editor group

File management

⌘N β€” New File

⌘O β€” Open File...

⌘S β€” Save

β‡§βŒ˜S β€” Save As...

βŒ₯⌘S β€” Save All

⌘W β€” Close

⌘K ⌘W β€” Close All

β‡§βŒ˜T β€” Reopen closed editor

⌘K β€” Enter Keep preview mode editor open

βŒƒTab / βŒƒβ‡§Tab β€” Open next / previous

⌘K P β€” Copy path of active file

⌘K R β€” Reveal active file in Finder

⌘K O β€” Show active file in new window/instance

Display

βŒƒβŒ˜F β€” Toggle full screen

βŒ₯⌘0 β€” Toggle editor layout (horizontal/vertical)

⌘= / β‡§βŒ˜- β€” Zoom in/out

⌘B β€” Toggle Sidebar visibility

β‡§βŒ˜E β€” Show Explorer / Toggle focus

β‡§βŒ˜F β€” Show Search

βŒƒβ‡§G β€” Show Source Control

β‡§βŒ˜D β€” Show Debug

β‡§βŒ˜X β€” Show Extensions

β‡§βŒ˜H β€” Replace in files

β‡§βŒ˜J β€” Toggle Search details

β‡§βŒ˜U β€” Show Output panel

β‡§βŒ˜V β€” Open Markdown preview

⌘K V β€” Open Markdown preview to the side

⌘K Z β€” Zen Mode (Esc Esc to exit)

Debug

F9 β€” Toggle breakpoint

F5 β€” Start/Continue

F11 / ⇧F11 β€” Step into/ out

F10 β€” Step over

⇧F5 β€” Stop

⌘K ⌘I β€” Show hover

Integrated terminal

βŒƒ` β€” Show integrated terminal

βŒƒβ‡§` β€” Create new terminal

⌘C β€” Copy selection

βŒ˜β†‘ / ↓ β€” Scroll up/down

PgUp / PgDn β€” Scroll page up/down

⌘Home / End β€” Scroll to top/bottom