cheat-sheets

VSCode shortcuts (macOS)

Default key bindings for Visual Studio Code on macOS. On Windows and Linux replace ⌘ with Ctrl and ⌥ with Alt. See VSCode (Visual Studio Code) for settings and extensions, and MacOS keyboard shortcuts for system keys.

General #

shortcutdescription
⌘ + ⇧ + PCommand palette
⌘ + PQuick open a file
⌘ + ,Settings
⌘ + ⇧ + OGo to symbol in file
⌃ + GGo to line
F12Go to definition
⌘ + /Toggle line comment

Side Menu #

shortcutdescription
⌘ + BShow or hide the side bar
⌘ + ⇧ + EExplorer
⌘ + ⇧ + FSearch across files
⌘ + FFind in the current file
⌘ + ⌥ + FReplace in the current file
⌃ + ⇧ + GSource control (Git)
⌘ + ⇧ + DRun and debug
⌘ + ⇧ + XExtensions
⌘ + JToggle the bottom panel

Multi-Cursor Editing #

shortcutdescription
⌘ + ⌥ + ↓add a cursor below (↑ for above)
⌥ + Clickadd a cursor at the mouse click
⌘ + Dselect the next occurrence of the current word
⌘ + ⇧ + Lselect all occurrences of the current selection

Split Editor #

shortcutdescription
⌘ + \split the editor
⌘ + 1focus the 1st editor group
⌘ + 2focus the 2nd editor group
⌃ + `toggle the integrated terminal
⌃ + tabswitch between open tabs
⌘ + `switch between VS Code windows
⌘ + ⇧ + Efocus the Explorer

IntelliSense #

shortcutdescription
⌃ + Spacetrigger suggestions
⌘ + ⇧ + Spacetrigger parameter hints
⌘ + .quick fix and code actions

Line Actions #

shortcutdescription
⇧ + ⌥ + ↓copy the line below
⇧ + ⌥ + ↑copy the line above
⌥ + ↓move the line down
⌥ + ↑move the line up
⌘ + ⇧ + Kdelete the line
⌘ + Enterinsert a line below
⌘ + ⇧ + Enterinsert a line above

Rename Refactoring #

shortcutdescription
F2 (Fn + F2)Rename symbol in the current project
Right-click, Rename SymbolRename symbol in the current project

Formatting #

shortcutdescription
⇧ + ⌥ + Fformat entire document
⌘ + K, ⌘ + Fformat selected text

Transform Selected Text #

The commands exist (Command palette: Transform to Uppercase, Transform to Lowercase, Transform to Snake Case, Transform to Title Case) but have no default key binding in current versions. Bind your own in keybindings.json if you use them often.

Code Folding #

shortcutdescription
⌘ + ⌥ + [fold
⌘ + ⌥ + ]unfold
⌘ + K, ⌘ + 0fold all
⌘ + K, ⌘ + Junfold all
⌘ + K, ⌘ + 1fold level 1
⌘ + K, ⌘ + 2fold level 2
⌘ + K, ⌘ + 5fold level 5

Errors and Warnings #

shortcutdescription
F8next error or warning
⇧ + F8previous error or warning
⌘ + ⇧ + Mopen the Problems panel

Not Verified #

Shortcuts are the long-standing macOS defaults, not re-checked against the newest release. Open the shortcut editor to confirm.

Search all sheets

Tip: / or Ctrl/Cmd+K to open, Esc to close.