VS Code Mac Keyboard Shortcuts

Discover useful VS Code keyboard shortcuts for macOS. Write code faster with essential and advanced commands. Boost daily development productivity on Mac.

Total Shortcuts: 115
Categories: 11
Application: Visual Studio Code
Platform:

All Keyboard Shortcuts

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

Why Keyboard Shortcuts Matter on macOS

On macOS, keyboard shortcuts follow a consistent pattern that makes them easier to learn. The ⌘ key serves as the primary modifier (similar to Ctrl on Windows), while ⌥ (Option) and ⇧ (Shift) provide additional functionality. Mastering these shortcuts can dramatically improve your coding efficiency.

macOS Consistency

⌘ shortcuts work across most macOS apps, making VS Code feel native.

Touch Bar Support

MacBook Touch Bar shows contextual shortcuts for even faster access.

Trackpad Integration

Combine keyboard shortcuts with macOS trackpad gestures for fluid navigation.

Mission Control

Use ⌃↑ and ⌃↓ to switch between VS Code and other apps seamlessly.

Frequently Asked Questions

To reset all keyboard shortcuts to default on macOS:
  1. Open Command Palette (++P)
  2. Search for "Preferences: Open Keyboard Shortcuts (JSON)"
  3. Delete or rename your keybindings.json file at: ~/Library/Application Support/Code/User/keybindings.json
  4. Restart VS Code to regenerate default shortcuts

On macOS:
  • (Command): Primary modifier for most application shortcuts (like +S for Save)
  • (Control): Used for system-level shortcuts and terminal commands
  • (Option/Alt): Used for alternative functions and special characters
  • (Shift): Used for capital letters and accessing upper symbols
In VS Code, is used for most editor commands, while is used for some navigation.

Customizing shortcuts on macOS:
  1. Open Keyboard Shortcuts (+K then +S)
  2. Search for the command you want to customize
  3. Click the pencil icon or double-click the keybinding
  4. Press your desired key combination
  5. Press to save
You can also edit the keybindings.json file directly for advanced customizations.

In the integrated terminal:
  • Use ++` to toggle terminal focus
  • +C works for copy (not +C like in regular terminal)
  • +V works for paste
  • Some macOS system shortcuts like +. (cancel) also work
For regular terminal commands, use +C to interrupt processes.

Yes, you have several options:
  • Keyboard Mapping: VS Code automatically maps Ctrl → ⌘ for common shortcuts
  • Customization: You can remap any shortcut in settings
  • Extensions: Use extensions like "Windows Keybindings for macOS"
  • System Level: Use macOS System Preferences → Keyboard → Shortcuts to remap keys
Most developers adapt to macOS shortcuts within 1-2 weeks for better consistency.