Keyboard shortcuts eliminate the time spent reaching for menus and mice. This reference covers the shortcuts that matter most for web development across your editor, browser, terminal, and operating system.
Notation: Cmd = macOS Command key. Windows/Linux equivalent is Ctrl unless noted. Opt = macOS Option key, equivalent to Alt on Windows/Linux.
VS Code — Editing
| Action | macOS | Windows/Linux |
|---|
| Cut line | Cmd+X | Ctrl+X |
| Copy line | Cmd+C | Ctrl+C |
| Move line up/down | Opt+Up/Down | Alt+Up/Down |
| Copy line up/down | Shift+Opt+Up/Down | Shift+Alt+Up/Down |
| Delete line | Cmd+Shift+K | Ctrl+Shift+K |
| Insert line below | Cmd+Enter | Ctrl+Enter |
| Insert line above | Cmd+Shift+Enter | Ctrl+Shift+Enter |
| Indent line | Cmd+] | Ctrl+] |
| Outdent line | Cmd+[ | Ctrl+[ |
| Toggle comment | Cmd+/ | Ctrl+/ |
| Block comment | Shift+Opt+A | Shift+Alt+A |
| Format document | Shift+Opt+F | Shift+Alt+F |
| Rename symbol | F2 | F2 |
| Quick fix | Cmd+. | Ctrl+. |
| Trigger suggestion | Ctrl+Space | Ctrl+Space |
| Toggle word wrap | Opt+Z | Alt+Z |
VS Code — Multi-cursor and Selection
| Action | macOS | Windows/Linux |
|---|
| Add cursor above/below | Cmd+Opt+Up/Down | Ctrl+Alt+Up/Down |
| Add cursor at click | Opt+Click | Alt+Click |
| Select current word | Cmd+D | Ctrl+D |
| Select all occurrences | Cmd+Shift+L | Ctrl+Shift+L |
| Select line | Cmd+L | Ctrl+L |
| Expand selection | Ctrl+Shift+Cmd+Right | Shift+Alt+Right |
| Shrink selection | Ctrl+Shift+Cmd+Left | Shift+Alt+Left |
| Column selection | Shift+Opt+Drag | Shift+Alt+Drag |
VS Code — Navigation
| Action | macOS | Windows/Linux |
|---|
| Command palette | Cmd+Shift+P | Ctrl+Shift+P |
| Quick open file | Cmd+P | Ctrl+P |
| Go to symbol | Cmd+Shift+O | Ctrl+Shift+O |
| Go to line | Ctrl+G | Ctrl+G |
| Go to definition | F12 | F12 |
| Peek definition | Opt+F12 | Alt+F12 |
| Go back | Ctrl+- | Alt+Left |
| Go forward | Ctrl+Shift+- | Alt+Right |
| Toggle sidebar | Cmd+B | Ctrl+B |
| Toggle terminal | Ctrl+` | Ctrl+` |
| Toggle explorer | Cmd+Shift+E | Ctrl+Shift+E |
| Toggle search | Cmd+Shift+F | Ctrl+Shift+F |
| Switch tabs | Cmd+1-9 | Ctrl+1-9 |
| Close tab | Cmd+W | Ctrl+W |
| Reopen closed tab | Cmd+Shift+T | Ctrl+Shift+T |
| Split editor | Cmd+\ | Ctrl+\ |
| Find in files | Cmd+Shift+F | Ctrl+Shift+F |
| Find and replace | Cmd+Opt+F | Ctrl+H |
| Action | macOS | Windows/Linux |
|---|
| Open DevTools | Cmd+Opt+I | Ctrl+Shift+I or F12 |
| Open Console | Cmd+Opt+J | Ctrl+Shift+J |
| Open Elements panel | Cmd+Opt+C | Ctrl+Shift+C |
| Inspect element | Cmd+Shift+C | Ctrl+Shift+C |
| Toggle device toolbar | Cmd+Shift+M | Ctrl+Shift+M |
| Run command | Cmd+Shift+P | Ctrl+Shift+P |
| Open file | Cmd+P | Ctrl+P |
| Search across files | Cmd+Opt+F | Ctrl+Shift+F |
| Toggle dock position | Cmd+Shift+D | Ctrl+Shift+D |
| Clear console | Cmd+K | Ctrl+L |
| Step over (debugging) | F10 | F10 |
| Step into | F11 | F11 |
| Step out | Shift+F11 | Shift+F11 |
| Resume execution | F8 | F8 |
| Toggle breakpoint | Cmd+B | Ctrl+B |
| Hard refresh (no cache) | Cmd+Shift+R | Ctrl+Shift+R |
Terminal / Command Line
| Action | macOS/Linux | Description |
|---|
Ctrl+C | Interrupt/kill current process | |
Ctrl+D | Exit shell / send EOF | |
Ctrl+Z | Suspend current process | Resume with fg |
Ctrl+L | Clear screen | Same as clear |
Ctrl+A | Move cursor to start of line | |
Ctrl+E | Move cursor to end of line | |
Ctrl+W | Delete word before cursor | |
Ctrl+U | Delete from cursor to start of line | |
Ctrl+K | Delete from cursor to end of line | |
Ctrl+R | Reverse search history | |
Ctrl+P / Up | Previous command | |
Ctrl+N / Down | Next command | |
Opt+Left | Move back one word | May need terminal config |
Opt+Right | Move forward one word | May need terminal config |
!! | Repeat last command | |
!$ | Last argument of previous command | |
Tab | Auto-complete | |
Tab Tab | Show all completions | |
macOS System
| Action | Shortcut |
|---|
| Spotlight search | Cmd+Space |
| Switch application | Cmd+Tab |
| Switch windows of same app | Cmd+` |
| Close window | Cmd+W |
| Quit application | Cmd+Q |
| Force quit | Cmd+Opt+Esc |
| Screenshot (full) | Cmd+Shift+3 |
| Screenshot (selection) | Cmd+Shift+4 |
| Screenshot (window) | Cmd+Shift+4, Space |
| Screen recording | Cmd+Shift+5 |
| Lock screen | Cmd+Ctrl+Q |
| Show desktop | F11 or Cmd+F3 |
| Mission Control | Ctrl+Up or F3 |
| Emoji picker | Ctrl+Cmd+Space |
| Minimize window | Cmd+M |
| Full screen | Cmd+Ctrl+F |
Windows System
| Action | Shortcut |
|---|
| Search | Win+S |
| Switch application | Alt+Tab |
| Close window | Alt+F4 |
| Task manager | Ctrl+Shift+Esc |
| Screenshot (full) | Win+PrtScn |
| Screenshot (selection) | Win+Shift+S |
| Lock screen | Win+L |
| Show desktop | Win+D |
| Virtual desktops | Win+Tab |
| Snap left/right | Win+Left/Right |
| File explorer | Win+E |
| Settings | Win+I |
| Emoji picker | Win+. |
| Clipboard history | Win+V |
Look up JavaScript key codes with the Keyboard Keycodes tool.