VS Code Shortcuts & Extensions Cheat Sheet
A reference for essential Visual Studio Code keyboard shortcuts, multi-cursor editing, and popular productivity extensions.
Editing Shortcuts
Faster text manipulation and multi-cursor editing.
- Ctrl+D- Select next occurrence of current word (multi-cursor)
- Alt+Click- Add a cursor at the clicked position
- Ctrl+/- Toggle line comment
- Alt+Up / Alt+Down- Move current line up or down
- Shift+Alt+Up / Down- Copy line up or down
- F2- Rename symbol across the file/project
- Ctrl+Space- Trigger IntelliSense suggestions
User settings.json Snippet
Common customizations placed in settings.json.
{ "editor.formatOnSave": true, "editor.tabSize": 2, "editor.fontSize": 14, "files.autoSave": "onFocusChange", "editor.minimap.enabled": false, "terminal.integrated.defaultProfile.linux": "bash"}
Popular Extensions
Widely used extensions that boost productivity.
- ESLint- Lints JavaScript/TypeScript code and highlights issues inline
- Prettier- Opinionated code formatter for many languages
- GitLens- Adds inline git blame, history, and repository insights
- Docker- Manage Dockerfiles, images, and containers from the editor
- Live Server- Launches a local dev server with live reload for static pages
- Python- Official Microsoft extension for Python IntelliSense, linting, debugging
tasks.json Build Task
Defining a custom build/run task wired to a keybinding or the Command Palette.
{ "version": "2.0.0", "tasks": [ { "label": "Run tests", "type": "shell", "command": "npm test", "group": { "kind": "test", "isDefault": true }, "problemMatcher": [] } ]}
launch.json Debug Config
Attaching the built-in debugger to a Node.js process.
{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Debug Current File", "program": "${file}", "skipFiles": ["<node_internals>/**"], "console": "integratedTerminal" } ]}
Custom Keybindings
Rebinding or adding shortcuts in keybindings.json, scoped by context.
[ { "key": "ctrl+alt+n", "command": "workbench.action.terminal.new" }, { "key": "ctrl+k ctrl+d", "command": "editor.action.formatDocument", "when": "editorTextFocus" }]
Advanced Multi-Cursor & Refactor Shortcuts
Power-user commands beyond the basic multi-cursor set.
- Ctrl+Shift+L- Select all occurrences of the current selection at once
- Ctrl+K Ctrl+I- Show hover info without moving the mouse (useful for keyboard-only debugging of types)
- Ctrl+Shift+. / Ctrl+.- Cycle through / trigger the Quick Fix and Refactor lightbulb menu
- Ctrl+Shift+O- Go to symbol within the current file; add `:` to group by category
- Ctrl+T- Go to symbol across the entire workspace
- Ctrl+K Z- Enter Zen Mode (distraction-free, hides all chrome)
- Ctrl+Shift+\- Jump to the matching bracket
Dev Container Config
Reproducible containerized dev environment via the Dev Containers extension.
{ "name": "node-dev", "image": "mcr.microsoft.com/devcontainers/javascript-node:20", "customizations": { "vscode": { "extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] } }, "postCreateCommand": "npm install", "forwardPorts": [3000]}
Use `code --diff file1 file2` from the terminal to open two files side by side in VS Code's diff viewer without leaving the command line.