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.

Matching shortcuts
Action Keys Row actions
Search available editor commands Command Palette Mac CmdShiftP 1 more variant Source
Find and open a project file Quick Open Mac CmdP 1 more variant Source
Toggle a line's comment state Code editor Mac Cmd/ 1 more variant Source
Remove the current code line Code editor Mac CmdShiftK 1 more variant Source
Shift a line downward Code editor Mac OptionDown arrow 1 more variant Source
Copy a line beneath itself Code editor Mac ShiftOptionDown arrow 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
Add the next matching selection Code editor Mac CmdD 1 more variant Source
Open the keybinding editor Ordered chord sequence Mac CmdKCmdS 1 more variant Source
Copy line Empty selection Windows CtrlC Source
Cut line Empty selection Windows CtrlX Source
Paste clipboard Editor Windows CtrlV Source
Undo change Editor Windows CtrlZ Source
Redo change Editor Windows CtrlY Source
Line below Editor Windows CtrlEnter Source
Line above Editor Windows CtrlShiftEnter Source
Move line up Editor Windows AltUp arrow Source
Copy line above Editor Windows ShiftAltUp arrow Source
Undo cursor Editor Windows CtrlU Source
Select occurrences Current selection Windows CtrlShiftL Source
Select current line Editor Windows CtrlL Source
Cursor below Editor Windows CtrlAltDown arrow Source
Cursor above Editor Windows CtrlAltUp arrow Source
Matching bracket Editor Windows CtrlShift\ Source
Indent line Editor Windows Ctrl] Source
Outdent line Editor Windows Ctrl[ Source
Find Editor Windows CtrlF Source
Replace Editor Windows CtrlH Source
Toggle wrapping Editor Windows AltZ 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