VS Code Shortcuts
Visual Studio Code keyboard shortcuts quick reference: editing, multi-cursor, navigation, find & replace, terminal, debugging, refactoring, snippets and settings.
Visual Studio Code is a free, open-source code editor by Microsoft. It combines a lightweight editor with powerful IDE-like features through extensions, an integrated terminal, and deep language support. Learning the keyboard shortcuts is the fastest way to become more productive.
Note: Shortcuts are for Windows/Linux. On macOS replace Ctrl with Cmd and Alt with Option.
General
| Shortcut | What it does |
|---|---|
| Ctrl+Shift+P / F1 | Command Palette - access every command in VS Code |
| Ctrl+P | Quick Open - search and open files by name |
| Ctrl+Shift+N | Open a new VS Code window |
| Ctrl+W | Close the current editor tab |
| Ctrl+Shift+T | Reopen the last closed editor tab |
| Ctrl+B | Toggle the Sidebar visibility |
| Ctrl+J | Toggle the Panel (Terminal, Output, Problems) |
| Ctrl+Shift+E | Show the File Explorer sidebar |
| Ctrl+Shift+G | Open the Source Control panel (Git) |
| Ctrl+Shift+X | Open the Extensions panel |
| Ctrl+Shift+D | Open the Run and Debug panel |
| Ctrl+, | Open Settings |
| Ctrl+K Ctrl+S | Open Keyboard Shortcuts |
| Ctrl+K Z | Zen Mode - full-screen distraction-free editing (Esc Esc to exit) |
Editor & Editing
| Shortcut | What it does |
|---|---|
| Ctrl+X | Cut current line (without selection) |
| Ctrl+C | Copy current line (without selection) |
| Ctrl+V | Paste (preserves indentation of the target line) |
| Alt+Up / Down | Move the current line (or selection) up/down |
| Shift+Alt+Up / Down | Duplicate the current line (or selection) up/down |
| Ctrl+Shift+K | Delete the current line |
| Ctrl+/ | Toggle line comment (//) |
| Shift+Alt+A | Toggle block comment (/* */) |
| Ctrl+D | Select the word at cursor (repeat to select next occurrence) |
| Ctrl+U | Undo the last cursor operation |
| Ctrl+Shift+\ | Jump to matching bracket |
| Ctrl+\ | Split the editor (create a new editor group) |
| Ctrl+1 / 2 / 3 | Focus editor group 1, 2 or 3 |
| Ctrl+K Ctrl+Left / Right | Focus the previous/next editor group |
| Ctrl+[ / ] | Indent / outdent the current line |
| Ctrl+Shift+Enter | Insert a new line above the current line |
| Ctrl+Enter | Insert a new line below the current line |
Multi-Cursor & Selection
Multi-cursor is one of VS Code's superpowers. Master these shortcuts for lightning-fast bulk editing.
| Shortcut | What it does |
|---|---|
| Alt+Click | Add a cursor at the clicked position |
| Ctrl+Alt+Up / Down | Add a cursor above/below the current line |
| Ctrl+D | Add the next occurrence of the selected word to the selection |
| Ctrl+Shift+L | Add all occurrences of the selected word (global rename) |
| Shift+Alt+I | Insert a cursor at the end of every selected line |
| Ctrl+Shift+O | Add all occurrences of current selection in the file |
| Esc | Remove all extra cursors (keep the primary) |
Find & Replace
| Shortcut | What it does |
|---|---|
| Ctrl+F | Find in the current file |
| Ctrl+H | Find and replace in the current file |
| Ctrl+Shift+F | Find in all files across the workspace |
| Ctrl+Shift+H | Find and replace across all files |
| F3 / Shift+F3 | Find next / previous match |
| Alt+Enter | Select all matches of the current search term |
| Ctrl+Shift+J | Toggle search details (regex, case, whole word) |
Integrated Terminal
| Shortcut | What it does |
|---|---|
| Ctrl+` | Toggle the integrated terminal |
| Ctrl+Shift+` | Create a new terminal instance |
| Ctrl+Shift+5 | Split terminal (create a second pane in the terminal panel) |
| Ctrl+Up / Down | Scroll terminal output |
| Ctrl+Shift+C / V | Copy / paste in the terminal (Windows/Linux) |
| Alt+Left / Right | Switch between terminal tabs |
| Delete (in terminal tab) | Kill the selected terminal instance |
Debugging
| Shortcut | What it does |
|---|---|
| F5 | Start debugging (or continue if paused) |
| Shift+F5 | Stop debugging |
| Ctrl+Shift+F5 | Restart debugging session |
| F9 | Toggle a breakpoint on the current line |
| F10 | Step over (execute the current line, do not dive into functions) |
| F11 | Step into the function call on the current line |
| Shift+F11 | Step out of the current function |
| Ctrl+F5 | Start without debugging (run, no breakpoints) |
| Ctrl+Shift+Y | Open the Debug Console |
Refactoring & IntelliSense
Language servers (via extensions) power renaming, quick fixes, and smart suggestions. These shortcuts make large code changes safe and fast.
| Shortcut | What it does |
|---|---|
| F2 | Rename the symbol under the cursor and update every reference across the project. |
| Ctrl+. | Quick fix / lightbulb: apply the suggested fix for an error or warning. |
| Ctrl+Shift+R | Refactor menu (extract method/variable, change signature, etc.). |
| Ctrl+Space | Manually trigger IntelliSense suggestions at the cursor. |
| Ctrl+Shift+Space | Trigger parameter hints for the current function call. |
| Ctrl+K Ctrl+I | Show hover information for the symbol under the cursor. |
| Alt+Shift+F | Format the whole document (uses the default formatter, e.g. Prettier). |
| Ctrl+K Ctrl+F | Format only the selected lines. |
Snippets & Settings
A few settings.json tweaks save time every single day. Snippets let you insert a block of code with a few keystrokes.
| Setting | What it does |
|---|---|
| "editor.formatOnSave": true | Auto-format the file every time you save. Pair with Prettier. |
| "editor.tabSize": 2 | Indentation width. Use 2 for JS/TS/HTML/CSS, 4 for Python. |
| "files.autoSave": "onFocusChange" | Save automatically when you leave a file. Fewer Ctrl+S taps. |
| "editor.wordWrap": "on" | Wrap long lines instead of scrolling horizontally. |
| "editor.renderWhitespace": "all" | Show spaces and tabs, making indentation bugs obvious. |
| "editor.minimap.enabled": false | Disable the minimap for more editing space (optional). |
| "git.autofetch": true | Auto-fetch from the remote so you always see branch state. |
| "files.exclude" | Hide build artifacts (e.g. "**/node_modules": true) from the Explorer. |
Define your own snippets with Ctrl+Shift+P → Preferences: Configure User Snippets.
{
"Log to console": {
"prefix": "clog",
"body": [
"console.log('$1', $1);",
"$2"
],
"description": "Insert a console.log"
}
}Essential Extensions
ESLint
Integrates ESLint - catches JS/TS errors and enforces code style as you type.
Prettier
Code formatter with support for JS, TS, CSS, HTML, JSON, Markdown, and more.
GitLens
Supercharges Git: blame annotations, code lens, inline history, and more.
Error Lens
Inline error messages directly in the editor (no need to hover).
Path Intellisense
Autocompletes filenames in import paths and strings.
Thunder Client
Lightweight REST API client built into VS Code (Postman alternative).