VS Code keyboard shortcuts for Mac
138 default VS Code shortcuts on Mac, grouped by task.
138 shortcuts
Keys:
General
7 shortcuts| Action | Keys |
|---|---|
| Show Command Palette | ShiftCmdPorF1 |
| Quick Open, go to file | CmdP |
| New window | ShiftCmdN |
| Close window | ShiftCmdW |
| Open User Settings | Cmd, |
| Open the keybindings editor | CmdK,CmdS |
| Open Microsoft's shortcut reference | CmdK,CmdR |
Basic editing
33 shortcuts| Action | Keys |
|---|---|
| Cut line (empty selection) | CmdX |
| Copy line (empty selection) | CmdC |
| Move line down | Option↓ |
| Move line up | Option↑ |
| Copy line down | OptionShift↓ |
| Copy line up | OptionShift↑ |
| Delete line | ShiftCmdK |
| Insert line below | CmdEnter |
| Insert line above | ShiftCmdEnter |
| Jump to matching bracket | ShiftCmd\ |
| Indent line | Cmd] |
| Outdent line | Cmd[ |
| Go to beginning of line | HomeorCmd← |
| Go to end of line | EndorCmd→ |
| Go to beginning of file | Cmd↑ |
| Go to end of file | Cmd↓ |
| Scroll line up | CtrlPageUp |
| Scroll line down | CtrlPageDown |
| Scroll page up | CmdPageUp |
| Scroll page down | CmdPageDown |
| Fold (collapse) region | OptionCmd[ |
| Unfold (uncollapse) region | OptionCmd] |
| Toggle fold | CmdK,CmdL |
| Fold all subregions | CmdK,Cmd[ |
| Unfold all subregions | CmdK,Cmd] |
| Fold all regions | CmdK,Cmd0 |
| Unfold all regions | CmdK,CmdJ |
| Fold all block comments | CmdK,Cmd/ |
| Add line comment | CmdK,CmdC |
| Remove line comment | CmdK,CmdU |
| Toggle line comment | Cmd/ |
| Toggle block comment | OptionShiftA |
| Toggle word wrap | OptionZ |
Navigation
10 shortcuts| Action | Keys |
|---|---|
| Show all symbols | CmdT |
| Go to line | CtrlG |
| Go to symbol in file | ShiftCmdO |
| Show Problems panel | ShiftCmdM |
| Go to next error or warning | F8 |
| Go to previous error or warning | ShiftF8 |
| Navigate editor group history | CtrlShiftTab |
| Go back | Ctrl- |
| Go forward | CtrlShift- |
| Toggle Tab moves focus | CtrlShiftM |
Search and replace
8 shortcuts| Action | Keys |
|---|---|
| Find | CmdF |
| Replace | OptionCmdF |
| Find nextFind widget open | EnterorCmdG |
| Find previousFind widget open | ShiftEnterorShiftCmdG |
| Select all occurrences of find matchFind widget open | OptionEnter |
| Toggle case-sensitiveFind widget open | OptionCmdC |
| Toggle regexFind widget open | OptionCmdR |
| Toggle whole wordFind widget open | OptionCmdW |
Multi-cursor and selection
11 shortcuts| Action | Keys |
|---|---|
| Insert cursor above | OptionCmd↑ |
| Insert cursor below | OptionCmd↓ |
| Undo last cursor operation | CmdU |
| Insert cursor at end of each selected line | OptionShiftI |
| Select current line | CmdL |
| Select all occurrences of current selection | ShiftCmdL |
| Add selection to next find match | CmdD |
| Select all | CmdA |
| Expand selection | CtrlShiftCmd→ |
| Shrink selection | CtrlShiftCmd← |
| Column (box) selection down | OptionShiftCmd↓ |
Rich languages editing
12 shortcuts| Action | Keys |
|---|---|
| Trigger suggestion | CtrlSpaceorCmdI |
| Trigger parameter hints | ShiftCmdSpace |
| Format document | OptionShiftF |
| Format selection | CmdK,CmdF |
| Go to definition | F12 |
| Peek definition | OptionF12 |
| Open definition to the side | CmdK,F12 |
| Quick Fix | Cmd. |
| Show references | ShiftF12 |
| Rename symbol | F2 |
| Trim trailing whitespace | CmdK,CmdX |
| Change file language | CmdK,M |
Editor management
10 shortcuts| Action | Keys |
|---|---|
| Close editor | CmdW |
| Close folder | CmdK,F |
| Split editor | Cmd\ |
| Focus into 1st, 2nd or 3rd editor group | Cmd1 |
| Focus into previous editor group | CmdK,Cmd← |
| Focus into next editor group | CmdK,Cmd→ |
| Move editor left | CmdK,ShiftCmd← |
| Move editor right | CmdK,ShiftCmd→ |
| Move active editor group left | CmdK,← |
| Move active editor group right | CmdK,→ |
File management
14 shortcuts| Action | Keys |
|---|---|
| Open folder | CmdO |
| New file | CmdN |
| Open file | CmdO |
| Save | CmdS |
| Save as | ShiftCmdS |
| Save all | OptionCmdS |
| Close all editors | CmdK,CmdW |
| Reopen closed editor | ShiftCmdT |
| Keep preview mode editor open | CmdK,Enter |
| Open next editor | CtrlTab |
| Open previous editor | CtrlShiftTab |
| Copy path of active file | CmdK,P |
| Reveal active file in Explorer or Finder | CmdK,R |
| Show active file in new window | CmdK,O |
Display
17 shortcuts| Action | Keys |
|---|---|
| Toggle full screen | CtrlCmdF |
| Toggle Zen Mode | CmdK,Z |
| Zoom in | Cmd= |
| Zoom out | Cmd- |
| Toggle Sidebar visibility | CmdB |
| Show Explorer | ShiftCmdE |
| Show Search | ShiftCmdF |
| Show Source Control | CtrlShiftG |
| Show Run and Debug | ShiftCmdD |
| Show Extensions | ShiftCmdX |
| Replace in files | ShiftCmdH |
| Toggle Search details | ShiftCmdJ |
| Show Output panel | ShiftCmdU |
| Toggle panel | CmdJ |
| Show Debug Console | ShiftCmdY |
| Open Markdown preview | ShiftCmdV |
| Open Markdown preview to the side | CmdK,V |
Debug
8 shortcuts| Action | Keys |
|---|---|
| Toggle breakpoint | F9 |
| Start or continue debugging | F5 |
| Start without debugging | CtrlF5 |
| Stop debugging | ShiftF5 |
| Step into | F11 |
| Step out | ShiftF11 |
| Step over | F10 |
| Show hover | CmdK,CmdI |
Integrated terminal
8 shortcuts| Action | Keys |
|---|---|
| Toggle integrated terminal | Ctrl` |
| Create new terminal | CtrlShift` |
| Scroll up (terminal)Terminal focused | Cmd↑ |
| Scroll down (terminal)Terminal focused | Cmd↓ |
| Scroll page up (terminal)Terminal focused | PageUp |
| Scroll page down (terminal)Terminal focused | PageDown |
| Scroll to top (terminal)Terminal focused | CmdHome |
| Scroll to bottom (terminal)Terminal focused | CmdEnd |
No shortcuts match. Try fewer words, the key names only, or search every app.
These are the default Visual Studio Code key bindings on Mac, from Microsoft's official list for version 1.96. Shortcuts that exist only on another system are left out here; the all-systems view shows every binding side by side.
Other systems: VS Code shortcuts for Windows, VS Code shortcuts for Linux. Or print the VS Code cheat sheet.