VS Code Shortcut Keys (Complete List with Examples)
Master VS Code with this exhaustive list of keyboard shortcuts to 10x your productivity.
VS Code shortcut keys are keyboard combinations that let you execute commands without reaching for your mouse. Instead of clicking through menus to format code, open files, or navigate between functions, you press a key combo and get instant results. These shortcuts are context-aware — they change behaviour based on what you're editing or which panel is active.
Think of shortcuts as speed multipliers for your workflow. The average developer spends 30-40% of their coding time on repetitive tasks like searching files, renaming variables, or toggling panels. Mastering even 10-15 shortcuts can cut that time in half, letting you stay in the flow state longer and ship features faster.
- Eliminates context switching — Your hands never leave the keyboard, keeping your brain focused on problem-solving instead of UI navigation
- Speeds up refactoring — Rename symbols across files, extract functions, or reformat entire documents in seconds instead of minutes
- Reduces cognitive load — Muscle memory handles navigation while your working memory stays fixed on logic and architecture
- Levels the playing field — Junior devs who know shortcuts often outpace seniors who rely on mouse clicks for everything
- Makes remote work smoother — Less mouse movement means less latency frustration on slower connections
Navigating your codebase efficiently is the foundation of productivity. These shortcuts help you jump between files, symbols, and lines without scrolling or clicking.
Quick Open (Ctrl+P / Cmd+P) is your file launcher. Type any part of a filename and hit Enter. Works with fuzzy matching — type "usrmod" to find user-model.ts. Add : after the filename to jump to a specific line number.
javascript// Press Ctrl+P, type "auth:42" to jump to line 42 in auth.js function validateToken(token) { if (!token) return false; const decoded = jwt.verify(token, SECRET_KEY); return decoded.exp > Date.now(); }
Go to Symbol (Ctrl+Shift+O / Cmd+Shift+O) lists all functions, classes, and variables in the current file. Type to filter, then jump instantly. Add : before your search to group symbols by type.
| Shortcut | Purpose | Pro Tip |
|---|---|---|
Ctrl+P | Open files | Add @ to search symbols across workspace |
Ctrl+G | Go to line | Type line number directly |
F12 | Go to definition | Works across files and node_modules |
Alt+←/→ | Navigate history | Jump back/forward through cursor positions |
These shortcuts transform how you write and manipulate code. They turn tedious multi-click operations into single keystrokes.
Multi-Cursor Editing (Ctrl+D / Cmd+D) selects the next occurrence of your current selection. Hit it three times to select three instances, then type to change all simultaneously. Use Ctrl+Shift+L to select ALL occurrences at once.
python# Select "status" and press Ctrl+D twice to edit all three user_status = "active" admin_status = "active" guest_status = "pending" # Now type "role" to replace all "status" with "role"
Move Line Up/Down (Alt+↑/↓ / Option+↑/↓) shifts entire lines without cut-paste. Copy Line Up/Down (Shift+Alt+↑/↓) duplicates lines instantly — perfect for creating similar function calls or CSS rules.
css.button { padding: 12px 24px; border-radius: 8px; /* Place cursor here, press Shift+Alt+↓ to duplicate */ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
Finding and replacing text is a daily task. These shortcuts make it surgical.
Find in Files (Ctrl+Shift+F / Cmd+Shift+F) searches your entire project. Use regex mode for pattern matching, and the files to include/exclude field to narrow scope. Alt+Enter selects all matches, turning them into multi-cursor positions.
| Find Type | Shortcut | When to Use |
|---|---|---|
| Current file | Ctrl+F | Quick variable checks |
| All files | Ctrl+Shift+F | Refactoring API calls, imports |
| Replace | Ctrl+H | Rename across single file |
| Replace all files | Ctrl+Shift+H | Mass updates (use with caution) |
typescript// Find "any" and replace with proper types across project // Before: function process(data: any) { } function process(data: UserData): Promise<Response> { return fetch('/api/users', { method: 'POST', body: JSON.stringify(data) }); }
Organizing your workspace keeps you focused. These shortcuts control what you see.
Toggle Sidebar (Ctrl+B / Cmd+B) hides the file explorer for more code space. Toggle Terminal (Ctrl+\`` / Cmd+`) brings up the integrated terminal without leaving VS Code. **Zen Mode** (Ctrl+K Z`) removes ALL UI chrome for deep focus.
Split Editor (Ctrl+\ / Cmd+\) creates side-by-side panes. Navigate between them with Ctrl+1/2/3. This is essential for comparing files or working with tests alongside implementation.
bash# Terminal example: Run build while viewing code npm run build:watch # Press Ctrl+` to hide terminal, Ctrl+1 to focus editor
VS Code's IntelliSense and refactoring tools are powerful, but only if you can trigger them quickly.
Trigger Suggest (Ctrl+Space) forces autocomplete when it doesn't appear automatically. Parameter Hints (Ctrl+Shift+Space) shows function signatures while typing arguments. Quick Fix (Ctrl+. / Cmd+.) opens the lightbulb menu for auto-imports, refactorings, and lint fixes.
| Action | Shortcut | Example Use |
|---|---|---|
| Rename symbol | F2 | Change variable name everywhere |
| Format document | Shift+Alt+F | Auto-fix indentation/spacing |
| Go to references | Shift+F12 | See all uses of a function |
| Peek definition | Alt+F12 | Inline view without switching files |
javascript// Place cursor on "calculateTotal", press F2, type new name function calculateTotal(items) { return items.reduce((sum, item) => sum + item.price, 0); } const cartTotal = calculateTotal(shoppingCart); // Both instances renamed automatically
| Need | Reach for |
|---|---|
| Open any file fast | Ctrl+P then type filename |
| Jump to function/class | Ctrl+Shift+O in current file |
| Edit multiple spots at once | Ctrl+D to select next occurrence |
| Move code blocks | Alt+↑/↓ to shift lines |
| See all file references | Shift+F12 on symbol |
| Fix imports/errors | Ctrl+. for Quick Fix menu |
| Hide all distractions | Ctrl+K Z for Zen Mode |
| Format messy code | Shift+Alt+F to auto-format |
| Search entire project | Ctrl+Shift+F for global find |
| Rename across files | F2 on variable/function |
- Ignoring Ctrl+P — New users keep clicking the file tree. Quick Open is 10x faster once you memorize it.
- Using Ctrl+F instead of Ctrl+Shift+F for refactoring — Single-file find misses references in other modules, breaking changes silently.
- Not customizing keybindings — Default shortcuts conflict with OS or extensions. Open Keyboard Shortcuts (
Ctrl+K Ctrl+S) and remap what feels awkward. - Forgetting Ctrl+. — You manually type import statements when Quick Fix would auto-import with one keystroke.
- Overusing Ctrl+Z instead of Ctrl+Shift+Z — Undo has a counterpart (Redo) that most people forget, leading to lost work after accidental undos.
- Selecting text before Move Line — You don't need to highlight code before using
Alt+↑/↓. Just place your cursor anywhere on the line.
💡 Think Like a Programmer: Your keyboard is a command-line interface for your editor. Every mouse click is a slow syscall — shortcuts are direct memory access to your workflow.
Keep Reading
VS Code Shortcut Keys (Complete List)
Read on to explore vs code shortcut keys (complete list) — a beginner-friendly walkthrough by Codekilla.
Master CSS Emmet Shortcuts in VS Code
Read on to explore master css emmet shortcuts in vs code — a beginner-friendly walkthrough by Codekilla.
VS Code Emmet Shortcuts for HTML With Examples
Read on to explore vs code emmet shortcuts for html with examples — a beginner-friendly walkthrough by Codekilla.
