Visual Studio Code Keyboard Shortcuts for Mac

Keyboard shortcuts for Visual Studio Code on Mac. Navigate the editor, manage files, and use the integrated terminal on macOS.
Key label style

General

Show Command Palette
Cmd+Shift+P
or
F1
Quick Open, Go to File…
Cmd+P
New window/instance
Cmd+Shift+N
Close window/instance
Cmd+W
User Settings
Cmd+,
Keyboard Shortcuts
Cmd+K,Cmd+S

Basic editing

Cut line (empty selection)
Cmd+X
Copy line (empty selection)
Cmd+C
Move line down/up
Opt+Down
or
Opt+Up
Copy line down/up
Opt+Shift+Down
or
Opt+Shift+Up
Delete line
Cmd+Shift+K
Insert line below/above
Cmd+Return
or
Cmd+Shift+Return
Jump to matching bracket
Cmd+Shift+\
Indent/outdent line
Cmd+]
or
Cmd+[
Go to beginning/end of line
Home
or
End
Go to beginning/end of file
Cmd+Up
or
Cmd+Down
Scroll line up/down
Ctrl+Pg Up
or
Ctrl+Pg Dn
Scroll page up/down
Cmd+Pg Up
or
Cmd+Pg Dn
Fold/unfold region
Cmd+Opt+[
or
Cmd+Opt+]
Fold/unfold all subregions
Cmd+K,Cmd+[
or
Cmd+K,Cmd+]
Fold/unfold all regions
Cmd+K,Cmd+0
or
Cmd+K,Cmd+J
Add line comment
Cmd+K,Cmd+C
Remove line comment
Cmd+K,Cmd+U
Toggle line comment
Cmd+/
Toggle block comment
Opt+Shift+A
Toggle word wrap
Opt+Z

Multi-cursor and selection

Insert cursor
Opt+Click
Insert cursor above
Cmd+Opt+Up
Insert cursor below
Cmd+Opt+Down
Undo last cursor operation
Cmd+U
Insert cursor at end of each line selected
Opt+Shift+I
Select current line
Cmd+L
Select all occurrences of current selection
Cmd+Shift+L
Select all occurrences of current word
Cmd+F2
Expand / shrink selection
Cmd+Ctrl+Shift+Right
or
Cmd+Ctrl+Shift+Left
Column (box) selection
Opt+Shift+Drag
Column (box) selection up/down
Cmd+Opt+Shift+Up
or
Cmd+Opt+Shift+Down
Column (box) selection left/right
Cmd+Opt+Shift+Left
or
Cmd+Opt+Shift+Right
Column (box) selection page up
Cmd+Opt+Shift+Pg Up
Column (box) selection page down
Cmd+Opt+Shift+Pg Dn

Search and replace

Find
Cmd+F
Replace
Cmd+Opt+F
Find next/previous
Cmd+G
or
Cmd+Shift+G
Select all occurrences of Find match
Opt+Return
Add selection to next Find match
Cmd+D
Move last selection to next Find match
Cmd+K,Cmd+D

Rich languages editing

Trigger suggestion
Ctrl+Space
or
Cmd+I
Trigger parameter hints
Cmd+Shift+Space
Format document
Opt+Shift+F
Format selection
Cmd+K,Cmd+F
Go to Definition
F12
Peek Definition
Opt+F12
Open Definition to the side
Cmd+K,F12
Quick Fix
Cmd+.
Show References
Shift+F12
Rename Symbol
F2
Trim trailing whitespace
Cmd+K,Cmd+X
Change file language
Cmd+K,M

Editor management

Close editor
Cmd+W
Close folder
Cmd+K,F
Split editor
Cmd+\
Focus into 1st, 2nd, 3rd editor group
Cmd+1
or
Cmd+2
or
Cmd+3
Focus into previous/next editor group
Cmd+K,Cmd+Left
or
Cmd+K,Cmd+Right
Move editor left/right
Cmd+K,Cmd+Shift+Left
or
Cmd+K,Cmd+Shift+Right
Move active editor group
Cmd+K,Left
or
Cmd+K,Right

File management

New File
Cmd+N
Open File...
Cmd+O
Save
Cmd+S
Save As...
Cmd+Shift+S
Save All
Cmd+Opt+S
Close
Cmd+W
Close All
Cmd+K,Cmd+W
Reopen closed editor
Cmd+Shift+T
Keep preview mode editor open
Cmd+K,Return
Open next / previous
Ctrl+Tab
or
Ctrl+Shift+Tab
Copy path of active file
Cmd+K,P
Reveal active file in Finder
Cmd+K,R
Show active file in new window/instance
Cmd+K,O

Display

Toggle full screen
Cmd+Ctrl+F
Toggle editor layout (horizontal/vertical)
Cmd+Opt+0
Zoom in/out
Cmd+=
or
Cmd+-
Toggle Sidebar visibility
Cmd+B
Show Explorer / Toggle focus
Cmd+Shift+E
Show Source Control
Ctrl+Shift+G
Show Debug
Cmd+Shift+D
Show Extensions
Cmd+Shift+X
Replace in files
Cmd+Shift+H
Toggle Search details
Cmd+Shift+J
Show Output panel
Cmd+Shift+U
Open Markdown preview
Cmd+Shift+V
Open Markdown preview to the side
Cmd+K,V

Debug

Toggle breakpoint
F9
Start/Continue
F5
Step into/ out
F11
or
Shift+F11
Step over
F10
Stop
Shift+F5
Show hover
Cmd+K,Cmd+I

Integrated terminal

Show integrated terminal
Ctrl+`
Create new terminal
Ctrl+Shift+`
Copy selection
Cmd+C
Scroll up/down
Cmd+Up
or
Cmd+Down
Scroll page up/down
Pg Up
or
Pg Dn
Scroll to top/bottom
Cmd+Home
or
Cmd+End

Intro

VS Code on macOS uses Command (⌘) as its primary modifier. The full shortcut set, command palette, file navigation, editor operations, terminal, debugger, and source control, follows this pattern throughout. A small number of shortcuts also use the Option (⌥) key, which handles word-by-word navigation and some multi-cursor operations that use Alt on Windows.

Mac-specific shortcut notes

Command Palette. Cmd+Shift+P opens the command palette, or F1 as an alternative. Every VS Code command is accessible from here. On Mac this follows the same Cmd+Shift pattern used across many Mac applications.

Word-by-word cursor movement. On macOS, Option+Left and Option+Right move the cursor one word at a time. This matches the standard macOS text navigation behavior used in every other Mac application. On Windows, the same operation uses Ctrl+Left and Ctrl+Right, so this is one of the more noticeable differences when switching between platforms.

Multi-cursor on Mac. Adding a cursor at an arbitrary position uses Option+Click. Adding cursors above or below the current line uses the Cmd+Option combination. The multi-cursor shortcuts use Option where Windows uses Alt.

Integrated terminal. The terminal toggle in VS Code on Mac uses Ctrl+` (backtick), note this is Ctrl, not Command, even on Mac. This is intentional in VS Code's design to keep terminal access consistent across platforms.

System shortcut conflicts. A small number of macOS system shortcuts share keys with VS Code defaults. Cmd+H hides the active application in macOS, pressing it in VS Code hides the window. The table above notes these cases. VS Code's keyboard settings panel can reassign any conflicting shortcuts.

Quick open. Cmd+P opens the quick file finder, type any part of a filename to jump to it. This is one of the most-used navigation shortcuts in VS Code on Mac.

Printable PDF

The VS Code macOS shortcut list is available as a printable PDF. The multi-cursor and debugger sections are good candidates for printing, these have enough distinct shortcuts that passive memorization from the table alone takes time.

FAQ

Need more than shortcuts?
Visit the Visual Studio Code app page for an overview and helpful links.

Want to suggest a new app, report a bug, or get help? Email us at info@hkeys.app.

For anything else or just a quick hello, write to us at info@hkeys.app.