VS Code Keyboard Shortcuts

100+ shortcuts — Mac & Windows. Search, filter by category, copy with one click. ★ marks the ones worth memorizing first.

⌘ = Command  ·  ⌥ = Option  ·  ⇧ = Shift  ·  ^ = Control
0 shortcuts

How to find any VS Code shortcut

These are the defaults — you can search and rebind anything.

Open the Keyboard Shortcuts editor

⌘K ⌘S (Mac) or Ctrl+K Ctrl+S (Windows) — search by action name, see current binding, double-click to remap.

Use the Command Palette

⌘⇧P / Ctrl+Shift+P — type any action name. VS Code shows the current keyboard shortcut next to each command.

Download the official PDF

Help → Keyboard Shortcut Reference — opens the official one-page PDF cheatsheet for your platform (Mac, Windows, or Linux).

Profile-specific shortcuts

VS Code Profiles let you save different keybinding sets for different projects or languages. Switch profiles via the gear icon in the bottom-left.

Frequently asked VS Code shortcut questions

What's the single most important VS Code shortcut to know?

The Command Palette — ⌘⇧P (Mac) / Ctrl+Shift+P (Windows). Every VS Code feature is reachable by typing its name. If you forget any shortcut, open the Palette and type what you want to do.

How do I select the same word in multiple places at once?

Click on a word, then press ⌘D (Mac) / Ctrl+D (Windows) repeatedly to add each next occurrence to your multi-selection. Press ⌘⇧L / Ctrl+Shift+L to select every occurrence at once. Then type to replace all of them simultaneously.

How do I jump to where a function is defined?

Place your cursor on any symbol and press F12 (Go to Definition — works on both platforms). Use ⌥F12 / Alt+F12 (Peek Definition) to preview the definition in a popup without leaving your current file.

How do I move a line up or down without cut/paste?

Press ⌥↑ / Alt+↑ to move the current line up, or ⌥↓ / Alt+↓ to move it down. Add ⇧ (Shift) to copy the line instead of moving it. Works with multi-line selections too.

Is there a shortcut for "Go Back" like a browser back button?

Yes — Ctrl+- (Mac) or Alt+← (Windows) goes to your previous cursor position, even across files. This is essential when you've jumped to a definition and want to return. Ctrl+⇧- / Alt+→ goes forward again.

How do I open a second terminal side by side?

With the terminal focused, press Ctrl+⇧5 (same on both platforms) to split the terminal panel. Or create a new separate terminal with Ctrl+⇧`. Switch between terminal instances using the dropdown in the terminal panel header.

How do I fold/collapse code blocks in VS Code?

Use ⌘⌥[ (Mac) / Ctrl+Shift+[ (Windows) to fold the current block, and ⌘⌥] / Ctrl+Shift+] to unfold. ⌘K ⌘0 / Ctrl+K Ctrl+0 folds all regions in the file. ⌘K ⌘J / Ctrl+K Ctrl+J unfolds everything.

What's the fastest way to rename a variable everywhere in the file?

Place cursor on the variable and press F2 (both platforms). Type the new name and press Enter. VS Code renames it across all files in the project that reference it — not just the current file — using language-aware renaming (not simple text replace).