Table of contents
- Command Palette
- Navigation
- Search & Replace
- Editing
- Multi-Cursor
- Refactoring & Code Actions
- Sidebar & Panel
- Terminal
- Run & Debug
Command Palette
Every feature in VS Code is accessible through the Command Palette. Searching by name is always faster than digging through menus.
| Action | Mac | Windows / Linux |
|---|---|---|
| Command Palette | command(⌘) shift(⇧) P | Ctrl Shift P |
| Quick Open file | command(⌘) P | Ctrl P |
| Open Settings | command(⌘) , | Ctrl , |
| Keyboard Shortcuts settings | command(⌘) K, command(⌘) S | Ctrl K, Ctrl S |
| New window | command(⌘) shift(⇧) N | Ctrl Shift N |
| Close current tab | command(⌘) W | Ctrl W |
command(⌘) P has one trick beyond opening files. Press it twice in a row and it toggles to the previously opened file. Faster than clicking tabs when switching between two files.
command(⌘) shift(⇧) P (Command Palette) and command(⌘) P (Quick Open) are actually the same input box. command(⌘) shift(⇧) P opens it with > pre-filled, while command(⌘) P opens it empty. Type > in command(⌘) P to get the Command Palette, or type # to search symbols.
Navigation
| Action | Mac | Windows / Linux |
|---|---|---|
| Go to definition | F12 | F12 |
| Peek definition | option(⌥) F12 | Alt F12 |
| Go to implementation | command(⌘) F12 | Ctrl F12 |
| Find references | shift(⇧) F12 | Shift F12 |
| Go to line | control(⌃) G | Ctrl G |
| Go to symbol in file | command(⌘) shift(⇧) O | Ctrl Shift O |
| Navigate back / forward | command(⌘) option(⌥) ← / → | Alt ← / → |
option(⌥) F12 (Peek Definition) shows the definition inline without leaving the current file. If you just want a quick look before coming back, option(⌥) F12 is better than jumping to another file with F12. Press Esc to close when done.
command(⌘) shift(⇧) O (Go to Symbol in File) is faster than scrolling when looking for a specific function or class in a long file. Type : after opening to group symbols by kind.
Search & Replace
| Action | Mac | Windows / Linux |
|---|---|---|
| Find in file | command(⌘) F | Ctrl F |
| Replace in file | command(⌘) H | Ctrl H |
| Find in project | command(⌘) shift(⇧) F | Ctrl Shift F |
| Replace in project | command(⌘) shift(⇧) H | Ctrl Shift H |
The project-wide search (command(⌘) shift(⇧) F) groups results by file, making it easy to see the scope of impact at a glance. Click a line in the results panel to jump to that file, and project-wide replace can be applied selectively on a per-file basis.
Editing
| Action | Mac | Windows / Linux |
|---|---|---|
| Move line up / down | option(⌥) ↑ / ↓ | Alt ↑ / ↓ |
| Copy line up / down | option(⌥) shift(⇧) ↑ / ↓ | Alt Shift ↑ / ↓ |
| Delete line | command(⌘) shift(⇧) K | Ctrl Shift K |
| Insert line below | command(⌘) Enter | Ctrl Enter |
| Insert line above | command(⌘) shift(⇧) Enter | Ctrl Shift Enter |
| Toggle line comment | command(⌘) / | Ctrl / |
| Toggle block comment | option(⌥) shift(⇧) A | Shift Alt A |
| Format document | option(⌥) shift(⇧) F | Shift Alt F |
| Format selection | command(⌘) K, command(⌘) F | Ctrl K, Ctrl F |
| Fold / unfold current block | command(⌘) option(⌥) [ / ] | Ctrl Shift [ / ] |
| Fold / unfold all | command(⌘) K, command(⌘) 0 / command(⌘) K, command(⌘) J | Ctrl K, Ctrl 0 / Ctrl K, Ctrl J |
option(⌥) ↑↓ (move) and option(⌥) shift(⇧) ↑↓ (copy) can be confusing at first. With shift, it copies; without, it moves. It’s worth remembering the difference so you don’t panic when the original line disappears.
Code folding (command(⌘) option(⌥) [/]) is useful when reading long files. Folding blocks you’re not interested in makes the overall structure visible at a glance. An effective approach is to fold everything with command(⌘) K, command(⌘) 0 and then unfold only the parts you need.
Multi-Cursor
One of the most powerful features in VS Code. When you need to edit the same pattern in multiple places simultaneously, instead of replacing them one by one, you can create multiple cursors and edit everything at once.
| Action | Mac | Windows / Linux |
|---|---|---|
| Add next occurrence to selection | command(⌘) D | Ctrl D |
| Select all occurrences | command(⌘) shift(⇧) L | Ctrl Shift L |
| Add cursor above / below | command(⌘) option(⌥) ↑ / ↓ | Ctrl Alt ↑ / ↓ |
| Add cursor at click position | option(⌥) click | Alt click |
| Undo last cursor selection | command(⌘) U | Ctrl U |
| Exit multi-cursor | Esc | Esc |
command(⌘) D adds the same word one at a time, letting you precisely select exactly as many as you want. If you need to change all of them, command(⌘) shift(⇧) L grabs everything at once.
If you accidentally place a cursor in the wrong spot while creating multi-cursors, command(⌘) U removes only the last one added. Esc dismisses all multi-cursors, so pressing it by mistake means starting over.
Refactoring & Code Actions
| Action | Mac | Windows / Linux |
|---|---|---|
| Rename symbol | F2 | F2 |
| Quick fix / code action | command(⌘) . | Ctrl . |
| Trigger autocomplete | control(⌃) Space | Ctrl Space |
| Show hover info | command(⌘) K, command(⌘) I | Ctrl K, Ctrl I |
command(⌘) . serves the same role as IntelliJ’s option(⌥) Enter. On errors, it shows fix suggestions; on valid code, it offers refactoring options. The suggestions depend on installed extensions, so make sure the extension for your language is installed for it to work properly.
Sidebar & Panel
| Action | Mac | Windows / Linux |
|---|---|---|
| Toggle sidebar | command(⌘) B | Ctrl B |
| Explorer | command(⌘) shift(⇧) E | Ctrl Shift E |
| Source Control | command(⌘) shift(⇧) G | Ctrl Shift G |
| Extensions | command(⌘) shift(⇧) X | Ctrl Shift X |
| Run and Debug | command(⌘) shift(⇧) D | Ctrl Shift D |
| Toggle bottom panel | command(⌘) J | Ctrl J |
| Problems panel | command(⌘) shift(⇧) M | Ctrl Shift M |
| Output panel | command(⌘) shift(⇧) U | Ctrl Shift U |
The pattern is command(⌘) shift(⇧) + the panel’s initial. Explorer is E, Source Control is G (Git), Extensions is X, Debug is D. Knowing the pattern makes them easy to remember.
Closing the sidebar with command(⌘) B gives the editor more room. Build the habit of closing it when focusing on code and opening it only when you need to browse files — it makes efficient use of screen space.
Terminal
| Action | Mac | Windows / Linux |
|---|---|---|
| Toggle terminal | control(⌃) ` | Ctrl ` |
| New terminal | control(⌃) shift(⇧) ` | Ctrl Shift ` |
| Split terminal | command(⌘) \ | Ctrl \ |
control(⌃) ` (backtick) for toggling the terminal is worth memorizing. The workflow of editing code, running a build, checking results, and returning to code stays uninterrupted with just the keyboard.
Run & Debug
| Action | Mac | Windows / Linux |
|---|---|---|
| Start / continue debug | F5 | F5 |
| Stop debug | shift(⇧) F5 | Shift F5 |
| Toggle breakpoint | F9 | F9 |
| Step Over | F10 | F10 |
| Step Into | F11 | F11 |
| Step Out | shift(⇧) F11 | Shift F11 |
VS Code’s debugger is configured via launch.json. Node.js works out of the box without extra configuration, but other languages require extensions. Start debugging with F5, and when it pauses at a breakpoint, use F10 (Step Over) and F11 (Step Into) to walk through the code line by line while inspecting variable values.
VS Code’s shortcut system uses many chord-style shortcuts that begin with command(⌘) K — things like command(⌘) K, command(⌘) S (keyboard shortcuts settings), command(⌘) K, command(⌘) F (format selection), and command(⌘) K, command(⌘) 0 (fold all). They feel awkward at first, but it helps to understand the pattern: “press command(⌘) K, then the next key specifies the action.” When you can’t remember a shortcut, open command(⌘) K, command(⌘) S to search for both the feature and its shortcut.


Loading comments...