Search and replace
Keyboard shortcuts for macOS
General
Reopen closed editor
⌘K Enter
Keep preview mode editor open
⌘F
Find
⌃Tab / ⌃⇧Tab
Replace
Open next / previous
⌥⌘F
⌘K P
Find next/previous
Copy path of active file
⌘G / ⇧⌘G
⌘K R
Select all occurrences of Find match
Reveal active file in Finder
⌥Enter
⌘K O
Add selection to next Find match
Show active file in new window/instance
⌘D
⌘K ⌘D
Move last selection to next Find match
⇧⌘P, F1
Show Command Palette
⌘P
Quick Open, Go to File…
⇧⌘N
New window/instance
⌘W
Close window/instance
⌃Space, ⌘I
⌘,
User Settings
⌘K ⌘S
Keyboard Shortcuts
Basic editing
⇧⌘T
Rich languages editing
Display
⌃⌘F
Toggle full screen
⌥⌘0
Trigger suggestion
Toggle editor layout (horizontal/vertical)
⌘= / ⇧⌘-
Trigger parameter hints
Zoom in/out
⇧⌘Space
⌘B
Format document
Toggle Sidebar visibility
⇧⌥F
⇧⌘E
Format selection
Show Explorer / Toggle focus
⌘K ⌘F
⇧⌘F
Go to Definition
Show Search
F12
⌃⇧G
Peek Definition
Show Source Control
⌥F12
⇧⌘D
Show Debug
⌘X
Cut line (empty selection)
⌘K F12
Open Definition to the side
⌘C
Copy line (empty selection)
⇧⌘X
Quick Fix
Show Extensions
⌘.
⌥↓ / ⌥↑
Move line down/up
⇧⌘H
Show References
Replace in files
⇧F12
⇧⌥↓ / ⇧⌥↑
Copy line down/up
⇧⌘J
Rename Symbol
Toggle Search details
F2
⇧⌘K
Delete line
⇧⌘U
Trim trailing whitespace
Show Output panel
⌘K ⌘X
⌘Enter / ⇧⌘Enter
Insert line below/above
⇧⌘V
Change file language
Open Markdown preview
⌘K M
⇧⌘\
Jump to matching bracket
⌘K V
Open Markdown preview to the side
⌘] / ⌘[
Indent/outdent line
⌘K Z
Zen Mode (Esc Esc to exit)
Home / End
Go to beginning/end of line
⌘↑ / ⌘↓
Go to beginning/end of file
⌘T
Show all Symbols
Debug
⌃PgUp / ⌃PgDn
Scroll line up/down
⌃G
Go to Line...
F9
Scroll page up/down
⌘P
Go to File...
Toggle breakpoint
⌘PgUp /⌘PgDn
F5
Fold/unfold region
⇧⌘O
Go to Symbol...
Start/Continue
⌥⌘[ / ⌥⌘]
F11 / ⇧F11
Fold/unfold all subregions
⇧⌘M
Show Problems panel
Step into/ out
⌘K ⌘[ / ⌘K ⌘]
F10
Fold/unfold all regions
F8 / ⇧F8
Go to next/previous error or warning
Step over
⌘K ⌘0 / ⌘K ⌘J
⇧F5
Add line comment
⌃⇧Tab
Navigate editor group history
Stop
⌘K ⌘C
⌘K ⌘I
Remove line comment
⌃- / ⌃⇧-
Go back/forward
Show hover
⌘K ⌘U
⌘/
Toggle line comment
⌃⇧M
Toggle Tab moves focus
⇧⌥A
Toggle block comment
⌥Z
Toggle word wrap
Navigation
Editor management
Integrated terminal
⌃`
Show integrated terminal
⌃⇧`
Create new terminal
Multi-cursor and selection
⌘W
Close editor
⌘C
Close folder
Copy selection
⌘K F
⌘↑ / ↓
Insert cursor
⌘\
Split editor
Scroll up/down
⌥ + click
PgUp / PgDn
Insert cursor above
⌘1 / ⌘2 / ⌘3
Focus into 1st, 2nd, 3rd editor group
Scroll page up/down
⌥⌘↑
⌘Home / End
Insert cursor below
⌘K ⌘← / ⌘K ⌘→
Focus into previous/next editor group
Scroll to top/bottom
⌥⌘↓
⌘U
Undo last cursor operation
⌘K ⇧⌘← / ⌘K ⇧⌘→
Move editor left/right
⇧⌥I
Insert cursor at end of each line selected
⌘K ← / ⌘K →
Move active editor group
⌘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
File management
⌘N
New File
⌘O
Open File...
⌘S
Save
⇧⌘S
Save As...
⌥⌘S
Save All
⌘W
Close
⌘K ⌘W
Close All
Other operating systems’ keyboard shortcuts and additional
unassigned shortcuts available at aka.ms/vscodekeybindings