Development

VSCode CheatSheet - macOS Edition

Captain Salem 2 min read

VSCode CheatSheet - macOS Edition

Improve your efficiency using vscode with the most useful keyboard shortcuts. This list will help you find what you need fast without ever taking your hands off the keyboard.

General

Keyboard Shortcut Action
shift + cmd + p Open the command palette
cmd + P Quick Open
shift + cmd + N New window
cmd + W Close window
cmd + k, cmd + c Clear the terminal screen
Cmd + Shift + O open symbol by name
Cmd + t Open recently used files
Opt + click Insert cursor at clicked location
shift + alt + click select multiple cursors at clicked locations

Basic editing

Keyboard Shortcut Action
cmd + X Cut line (empty selection)
cmd + C Copy Line (empty selection)
opt + Arrow up/down Move line up/down
shift + cmd + K Delete line
Shift + cmd + \ Jump to matching bracket
cmd + K + C Add line comment
cmd + K + U Remove line comment
opt + Z Toggle word wrap
shift + opt + A Toggle block comment
cmd + / Toggle line comment
Home / End Go to beginning / end of line
cmd + arrow up / down Go to beginning / end of file
cmd + PgUp / PgDn Scroll page up / down

Search and replace

Keyboard Shortcut Action
cmd + F Find
opt + cmd + F Replace
cmd + G / shift + cmd + G Find next / Previous
opt + Enter Select all occurrence of find match
cmd + D Add selection to next find match
cmd + K + cmd + D Move last selection to next find match

Rich languages editing

Keyboard Shortcut Action
^ + Space, cmd + I Trigger Suggestion
shift + cmd + space Trigger parameter hints
shift + opt + F Format document
cmd + K + cmd + F Format document
F12 Go to definition
opt + F12 Peek definition
cmd + K + F12 Open definition to the side
cmd + . Quick fix
shift + F12 Show references
F2 Rename Symbol
cmd + K + cmd + X Trim trailing whitespace
cmd + K + M change file language
Keyboard Shortcut Action
cmd + T Show all symbols
^ + G Go to line
cmd + P Go to file
shift + cmd + O Go to symbol
shift + cmd + M Show problems panel
F8 / shift + F8 Go to next / previous error/warning
^ + shift + Tab Navigate editor group history
^ + - / ^ + shift + - Go back / Forward
^ + shift + M Toggle tab moves focus

Editor Management

Keyboard Shortcut Action
cmd + W Close editor
cmd + K + F close folder
cmd + \ split editor
cmd + 1 / cmd + 2 / cmd + 3 Focus into 1st, 2nd or 3rd editor group
cmd + K + cmd + arrowleft/arrowright Focus into previous / next editor group
cmd + shift + K + cmd + arrowleft/arrowright Move editor left / right
cmd + K + leftarrow/rightarrow Move active editor group

File Management

Keyboard Shortcut Action
cmd + N New file
cmd + O Open file
cmd + S Save
shift + cmd + S Save as
opt + cmd + S Save all
cmd + W Close
cmd + K + cmd + W Close All
shift + cmd + T Reopen closed editor
cmd + K + Enter Keep Preview mode editor open
^ + Tab / ^ + shift + Tab Open next / previous
cmd + K + P Copy path of active file
cmd + K + R Reveal active file in finder
cmd + K + O Show active file in new window / instance

Display

Keyboard Shortcut Action
^ + cmd + F Toggle full screen
opt + cmd + 0 Toggle editor layout (horizontal/vertical)
cmd + = / shift + cmd + - Zoom in/Out
cmd + B Toggle Sidebar visibility
shift + cmd + E Show explorer / Toggle focus
shift + cmd + F Show search
^ + shift + G Show source control
shift + cmd + D Show debug
shift + cmd + X Show extensions
shift + cmd + H Replace in files
shift + cmd + J Toggle seaerch details
shift + cmd + U Show output panel
shift + cmd + V Open markdown preview
cmd + K + V Open Markdow preview to the side
cmd + K + Z Zen Mode (Esc Esc to exit)

Debug

Keyboard Shortcut Action
F9 Toggle breakpoint
F5 Start / Continue
F11 / shift + F11 Step into / out
F10 Step Over
shift + F5 Stop
cmd + K + cmd + I Show hover
Share
Comments
More from Cloudenv

Cloudenv

Developer Tips, Tricks and Tutorials.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Cloudenv.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.