VS Code Shortcuts You Should Know

VS Code Shortcuts You Should Know

15 keyboard shortcuts that most developers never learn - but should.

Most developers use maybe 10% of what VS Code can do. They reach for the mouse constantly, click through menus, and scroll through files line by line. Meanwhile, the shortcuts that would save them hours per week are sitting right there.

Here are 15 shortcuts that genuinely changed how I work. Grouped by what you're actually trying to do.

Navigation

Quick Open - Ctrl+P

Stop clicking through the file explorer. Hit Ctrl+P, start typing a filename, and press Enter. Fuzzy matching means you don't need the exact name - type "usrctl" and it'll find userController.js. This single shortcut will save you more time than anything else on this list.

Command Palette - Ctrl+Shift+P

Every single action in VS Code is available here. Change settings, install extensions, format code, change language mode. If you don't know the shortcut for something, the command palette is your fallback. Start typing what you want and it'll find it.

Go to Definition - F12

Click on a function name, hit F12, and you're at its definition. Works across files. Hold Ctrl and click for the same effect with a mouse. Once you're there, Alt+Left takes you back to where you were.

Peek Definition - Alt+F12

Same as Go to Definition, but it opens an inline preview instead of navigating away. Perfect when you just want to check a function signature without losing your place.

Go to Line - Ctrl+G

Error on line 247? Don't scroll. Ctrl+G, type 247, Enter. You're there.

Editing

Multi-Cursor Selection - Ctrl+D

Select a word, then press Ctrl+D to also select the next occurrence. Keep pressing it to grab more. Now type your replacement and all instances change at once. This is faster than find-and-replace for small batches.

Multi-Cursor Anywhere - Alt+Click

Hold Alt and click at multiple positions to place cursors wherever you want. Type once, edit everywhere. Great for adding the same prefix or suffix to multiple lines.

Duplicate Line - Shift+Alt+Down

Need to duplicate the current line below? One shortcut. No copy, no paste, no selecting the line first. Shift+Alt+Up duplicates upward.

Move Line Up/Down - Alt+Up / Alt+Down

Grab the current line and shift it up or down. Works with selections too - select a block and move the whole thing. Beats cutting and pasting every time.

Fold/Unfold Code - Ctrl+Shift+[ / Ctrl+Shift+]

Collapse a code block to hide the details. Unfold it when you need to see inside. Ctrl+K+Ctrl+0 folds everything. Ctrl+K+Ctrl+J unfolds everything.

Workspace

Toggle Sidebar - Ctrl+B

Quick way to get more screen space when you're focused on code. Toggle it back when you need the file explorer or source control panel.

Toggle Terminal - Ctrl+`

Open and close the integrated terminal without leaving your editor. No more alt-tabbing to a separate terminal window. Ctrl+Shift+` creates a new terminal instance.

Zen Mode - Ctrl+K+Z

Strips away everything - sidebar, status bar, tabs, activity bar. Just you and your code, centered on screen. Hit Escape twice to exit. Surprisingly useful for deep focus sessions.

Split Editor - Ctrl+\\

View two files side by side. Essential when you're working on a component and its test, or a controller and its route definition.

Toggle Word Wrap - Alt+Z

Long lines wrapping off screen? Toggle word wrap on. Dealing with structured data where wrapping hurts readability? Toggle it off. Simple and frequently needed.

Start Building the Habit

Don't try to memorize all 15 at once. Pick 2-3 that match what you do most and force yourself to use them for a week. Once they're automatic, add more.

Want the complete reference? Check out the full VS Code keyboard shortcuts cheat sheet organized by category.

← Back to all cheat sheets