Comprehensive Visual Studio Code (VSCode) Cheatsheet
A complete VSCode reference: essential keyboard shortcuts for macOS and Windows/Linux, must-have extensions, settings, multi-cursor editing, and the integrated terminal.
Visual Studio Code is the most popular code editor for web and systems development. This cheatsheet covers the shortcuts and settings that matter most day to day.
Keyboard Shortcuts
Shortcuts are listed as Mac / Windows/Linux.
General
| Action | Mac | Windows/Linux |
|---|---|---|
| Command Palette | ⇧⌘P | Ctrl+Shift+P |
| Open file | ⌘P | Ctrl+P |
| Toggle sidebar | ⌘B | Ctrl+B |
| Toggle terminal | ⌃` | Ctrl+` |
| Open settings | ⌘, | Ctrl+, |
| Open keyboard shortcuts | ⌘K ⌘S | Ctrl+K Ctrl+S |
| New file | ⌘N | Ctrl+N |
| Save | ⌘S | Ctrl+S |
| Save all | ⌥⌘S | Ctrl+K S |
| Close editor | ⌘W | Ctrl+W |
| Close window | ⌘Q | Alt+F4 |
Editing
| Action | Mac | Windows/Linux |
|---|---|---|
| Cut line | ⌘X | Ctrl+X |
| Copy line | ⌘C | Ctrl+C |
| Move line up/down | ⌥↑ / ⌥↓ | Alt+↑ / Alt+↓ |
| Duplicate line | ⇧⌥↓ | Shift+Alt+↓ |
| Delete line | ⇧⌘K | Ctrl+Shift+K |
| Insert line below | ⌘Enter | Ctrl+Enter |
| Insert line above | ⇧⌘Enter | Ctrl+Shift+Enter |
| Jump to matching bracket | ⇧⌘\ | Ctrl+Shift+\ |
| Indent/outdent line | ⌘] / ⌘[ | Ctrl+] / Ctrl+[ |
| Toggle line comment | ⌘/ | Ctrl+/ |
| Toggle block comment | ⇧⌥A | Shift+Alt+A |
| Format document | ⇧⌥F | Shift+Alt+F |
| Format selection | ⌘K ⌘F | Ctrl+K Ctrl+F |
| Undo | ⌘Z | Ctrl+Z |
| Redo | ⇧⌘Z | Ctrl+Y |
Multi-Cursor Editing
| Action | Mac | Windows/Linux |
|---|---|---|
| Add cursor above/below | ⌥⌘↑ / ⌥⌘↓ | Ctrl+Alt+↑ / Ctrl+Alt+↓ |
| Add cursor at click | ⌥Click | Alt+Click |
| Select next occurrence | ⌘D | Ctrl+D |
| Select all occurrences | ⇧⌘L | Ctrl+Shift+L |
| Column (box) select | ⇧⌥Drag | Shift+Alt+Drag |
Navigation
| Action | Mac | Windows/Linux |
|---|---|---|
| Go to line | ⌃G | Ctrl+G |
| Go to symbol in file | ⇧⌘O | Ctrl+Shift+O |
| Go to symbol in workspace | ⌘T | Ctrl+T |
| Go to definition | F12 | F12 |
| Peek definition | ⌥F12 | Alt+F12 |
| Go back / forward | ⌃- / ⌃⇧- | Alt+← / Alt+→ |
| Switch editor tab | ⌘1, ⌘2... | Ctrl+1, Ctrl+2... |
| Split editor | ⌘\ | Ctrl+\ |
Search and Replace
| Action | Mac | Windows/Linux |
|---|---|---|
| Find | ⌘F | Ctrl+F |
| Replace | ⌥⌘F | Ctrl+H |
| Find in files | ⇧⌘F | Ctrl+Shift+F |
| Replace in files | ⇧⌘H | Ctrl+Shift+H |
| Toggle case-sensitive | ⌥⌘C | Alt+C |
| Toggle regex | ⌥⌘R | Alt+R |
File Explorer
| Action | Mac | Windows/Linux |
|---|---|---|
| New file | N (in explorer focus) | N |
| New folder | ⇧N | Shift+N |
| Rename | Enter | F2 |
| Delete | ⌫ | Delete |
Essential Extensions
General Development
- ESLint — JavaScript linting
- Prettier — code formatting for JS, TS, CSS, JSON, Markdown
- GitLens — enhanced Git blame, history, and diffs
- IntelliCode — AI-assisted code completions
- Path Intellisense — autocomplete for file paths
- Error Lens — inline error and warning display
Python
- Python (Microsoft) — language support, IntelliSense, debugging
- Pylance — fast type checking and IntelliSense
- Python Docstring Generator — auto-generate docstrings
Web Development
- Live Server — live reload for HTML/CSS
- Auto Rename Tag — auto-rename paired HTML/XML tags
- CSS Peek — peek into CSS from HTML class names
Remote Development
- Remote - SSH — edit files on remote servers over SSH
- Remote - WSL — develop inside WSL on Windows
- Dev Containers — develop inside Docker containers
Popular Themes
- Dracula Official
- One Dark Pro
- Night Owl
- Catppuccin
- Tokyo Night
Recommended Fonts
Install Fira Code or Cascadia Code for ligature support.
Useful Settings (settings.json)
Open with: ⌘⇧P → "Open User Settings (JSON)"
{
"editor.fontFamily": "'Fira Code', 'Cascadia Code', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 14,
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.minimap.enabled": false,
"editor.wordWrap": "on",
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": true,
"files.autoSave": "onFocusChange",
"workbench.colorTheme": "Dracula",
"terminal.integrated.fontSize": 13,
"explorer.confirmDelete": false,
"editor.linkedEditing": true
}
Integrated Terminal Tips
# Open new terminal
Ctrl+` (or ⌃`)
# Split terminal
Ctrl+Shift+5 (or ⌘\)
# Switch between terminals
Ctrl+PageUp / Ctrl+PageDown
Run tasks from the Command Palette: ⇧⌘P → "Run Task" — configure tasks in .vscode/tasks.json.
Workspace Settings
Per-project settings go in .vscode/settings.json:
{
"editor.tabSize": 4,
"python.defaultInterpreterPath": "./venv/bin/python"
}
This overrides user settings for the current workspace only, making it easy to enforce consistent formatting across a team when committed to version control.