iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

Cheatsheet

A one-screen reference of the VS Code shortcuts, settings, and tricks that pay back the most time per memorised line. Pin it to a tab; you will not regret it.

VS Code by-the-shortcuts cheatsheet

EXAMPLE
# ===== Core movement =====
# Ctrl+P                 quick open file
# Ctrl+Shift+P           command palette (the menu)
# Ctrl+G                 go to line
# Ctrl+T                 go to symbol across the workspace
# Ctrl+Shift+O           go to symbol in current file
# F12 / Alt+F12          go to definition / peek definition
# Shift+F12              show all references
# Ctrl+Tab               recent files

# ===== Editing =====
# Alt+Up/Down            move line up/down
# Shift+Alt+Up/Down      duplicate line
# Ctrl+/                 toggle line comment
# Shift+Alt+A            toggle block comment
# Ctrl+D                 add next occurrence to selection
# Ctrl+Shift+L           select all occurrences in file
# Alt+Click              add a cursor at a new position
# Ctrl+Alt+Up/Down       add cursor above/below
# Shift+Alt+Drag         column selection
# Ctrl+L                 expand selection by line
# Ctrl+Shift+K           delete line
# Ctrl+Enter             new line below (without splitting)
# Ctrl+]                 indent / Ctrl+[ outdent

# ===== Refactor =====
# F2                     rename symbol everywhere
# Ctrl+.                 quick fix / refactor menu
# Shift+Alt+F            format document
# Ctrl+Shift+\           jump to matching bracket

# ===== Search =====
# Ctrl+F                 find in file
# Ctrl+H                 replace in file
# Ctrl+Shift+F           find across project
# Ctrl+Shift+H           replace across project
# F3 / Shift+F3          find next / previous

# ===== Panels =====
# Ctrl+B                 toggle sidebar
# Ctrl+\\`                toggle integrated terminal
# Ctrl+Shift+M           problems panel
# Ctrl+Shift+G           source control
# Ctrl+Shift+E           explorer

# ===== Multi-window / split =====
# Ctrl+\\                split editor
# Ctrl+1 / 2 / 3         focus editor group N
# Ctrl+K W               close all editors

# ===== Common settings.json snippets =====
# {
#   "editor.formatOnSave": true,
#   "editor.codeActionsOnSave": { "source.organizeImports": "explicit" },
#   "editor.bracketPairColorization.enabled": true,
#   "editor.guides.bracketPairs": "active",
#   "editor.minimap.enabled": false,
#   "editor.rulers": [80, 120],
#   "editor.tabSize": 2,
#   "editor.cursorBlinking": "smooth",
#   "files.exclude": { "**/.turbo": true, "**/dist": true },
#   "search.exclude": { "**/node_modules": true, "**/dist": true, "**/*.lock": true },
#   "workbench.editor.enablePreview": false,
#   "workbench.list.smoothScrolling": true,
#   "terminal.integrated.scrollback": 100000
# }

# ===== Use VS Code as the git editor (and merge tool) =====
# git config --global core.editor 'code --wait'
# git config --global merge.tool vscode
# git config --global mergetool.vscode.cmd 'code --wait $MERGED'

# ===== CLI tricks =====
# code path           open a file or folder
# code --diff a b     diff two files
# code --add path     add folder to current workspace
# code --reuse-window
# code --goto file:line:column
# code --install-extension dbaeumer.vscode-eslint

Why it matters

Bind Ctrl+P + the type-to-filter approach into muscle memory. Once you stop hunting files in the explorer, every other keyboard productivity gain compounds — the average open-a-file-and-jump-to-symbol round-trip drops from seconds to under a second.

Tip: Tweak the snippet with Try it Yourself », then sit the quiz at the bottom of the page.

Example

Example
// Palette | Quick Open | Multi-cursor | Format on Save | Integrated Terminal | Git view | Tasks
Try it Yourself »

Discussion

Loading…