Skip to the main content

Visual Studio Code keyboard shortcuts

Default editor keymap for code navigation, selection, and editing.

34 shortcuts Mac and Windows checked September 11, 2026

Print all 34 shortcuts One sheet with every shortcut in this app, ready for the printer or a PDF.

8 actions and 11 key variants match.

Search all apps

Matching shortcuts
Action Keys Row actions
Toggle a line's comment state Code editor Mac Cmd/ 1 more variant Source
Format the current file Formatter available A formatter must be installed for the current file type. Mac ShiftOptionF 1 more variant Source
Rename the current symbol Language support available Language support must be available for the current file. Mac F2 1 more variant Source
Matching bracket Editor Windows CtrlShift\ Source
Fold region Foldable region Windows CtrlShift[ Source
Unfold region Folded region Windows CtrlShift] Source
Add comment Language support Language support must be available for the current file. Windows CtrlKCtrlC Source
Remove comment Language support Language support must be available for the current file. Windows CtrlKCtrlU Source

About Visual Studio Code and its shortcuts

Visual Studio Code is built around the command palette, and that changes how its keyboard works: almost everything is reachable by typing a command name, with bound keys as the fast path for what you repeat. Beyond that, the valuable groups are multi-cursor editing, navigation between files and symbols, and the integrated terminal.

Extensions add and override bindings freely, so two installations can behave differently. Microsoft publishes separate reference sheets per system, and keymap extensions that imitate other editors replace large parts of the default set.

Where the Visual Studio Code keys came from

Read from 1 documentation page published by the makers of Visual Studio Code. Report a key that is wrong

To see how one action is done in other apps as well as Visual Studio Code, browse the shortcuts by task. Shortcuts by task