Quick tricks - VS Code keyboard shortcuts
Here is a list of useful keyboard shortcuts for Visual Studio Code:
PC Shortcut | Mac Shortcut | Result |
---|---|---|
[Ctrl + Shift + P] | CMD + SHIFT + P | Command Palette |
[Ctrl + Shift + F] | CMD + SHIFT + F | Search Files |
[Ctrl + Alt + Up/Down(keyboard button)] | CMD + ALT + UP OR DOWN | Multiple Cursors |
[Ctrl + Shift + K] | CMD + SHIFT + K | Delete the Line |
Shift + Alt + Up/Down(keyboard button) | SHIFT + ALT + UP OR DOWN | Copy Line Up/Down |
 | CMD + ] | Manually indent code |
[Ctrl + Shift + V] | CMD + SHIFT + V | Preview Markdown |
[Ctrl + K then V] | CMD + K THEN V | Preview Side by Side |
[Ctrl + Shift + O] | CMD + SHIFT + O | Jump to Header |
[Ctrl + >] | CMD + Arrow | Surround with Menu |
CTRL + P | CMD + P | Go to file |
ALT + SHIFT + [ OR ] | CMD + SHIFT + [ OR ] | Go to next open file |
CTRL + G | CTRL + G | Go to specific line |
F8 | CMD + SHIFT + M | Navigate errors and warnings |
CTRL + SHIFT + \ | CMD + SHIFT + \ | Go to outer bracket |
SHIFT + ALT + ARROW | CMD + SHIFT + CTRL + ARROW | Expand or Shrink selection |
CTRL + ALT + [ OR ] | CMD + ALT + [ OR ] | Fold or unfolder all subregions |
CTRL + K, CTRL + 0 (Zero) | CMD + K, CMD + 0 | Fold all regions |
CTRL + K, CTRL + J | CMD + K, CMD + J | Unfold all regions |
CMD + Up or Down | Go to bottom or top | Â |
CMD + ALT + LEFT OR RIGHT | Go along to the next file | Â |
SHIFT + ALT + F | OPT + SHIFT + F | Format your code |
ALT + Z | ALT + Z | Word wrap |
CTRL + SHIFT + K | CMD + SHIFT + K | Delete current line |
SHIFT + ALT + O | OPT + SHIFT + O | Remove unused imports |
CTRL + / | CMD + / | Toggle Line Comment |
SHIFT + ALT + A | SHIFT + OPT + A | Toggle Block Comment |
CTRL + D | CMD + D | Highlight subsequent instances of text |
CTRL + U | CMD + U | Undo last selection |
These tricks are part of the Dev Digest Newsletter.