Updated May 2026 · 9 min read

VS Code Keyboard Shortcuts: The Complete Guide for Developers

Visual Studio Code is the world's most popular code editor, used by over 70% of developers. Its keyboard shortcut system is one of the deepest of any editor — and learning it properly can cut your coding time by 30% or more. This guide covers every major category: navigation, editing, multi-cursor, terminal, and debugging.

For the full interactive reference, see the VS Code shortcuts cheat sheet.

The Core VS Code Shortcuts (Learn These First)

ActionWindows / LinuxMac
Command PaletteCtrl+Shift+P⌘+Shift+P
Quick Open (file search)Ctrl+P⌘+P
Open integrated terminalCtrl+`Ctrl+`
Toggle sidebarCtrl+B⌘+B
Go to definitionF12F12
Rename symbolF2F2
Format documentShift+Alt+FShift+Option+F
Comment/uncommentCtrl+/⌘+/

Navigation Shortcuts

Speed through large codebases without touching the file explorer or scrollbar.

ActionWindows / LinuxMac
Go to fileCtrl+P⌘+P
Go to line numberCtrl+GCtrl+G
Go to symbol in fileCtrl+Shift+O⌘+Shift+O
Go to symbol in workspaceCtrl+T⌘+T
Go back / forwardAlt+← / →Ctrl+- / Ctrl+Shift+-
Jump to matching bracketCtrl+Shift+\⌘+Shift+\
Switch between open editorsCtrl+TabCtrl+Tab
Close current editorCtrl+W⌘+W
Reopen closed editorCtrl+Shift+T⌘+Shift+T

Multi-Cursor Editing

Multi-cursor is one of VS Code's most powerful features for editing repetitive code patterns.

ActionWindows / LinuxMac
Add cursor above / belowCtrl+Alt+↑ / ↓⌘+Option+↑ / ↓
Click to add cursorAlt+ClickOption+Click
Select next occurrenceCtrl+D⌘+D
Select all occurrencesCtrl+Shift+L⌘+Shift+L
Column (box) selectShift+Alt+dragShift+Option+drag
Undo last cursor operationCtrl+U⌘+U

Code Editing Shortcuts

ActionWindows / LinuxMac
Move line up / downAlt+↑ / ↓Option+↑ / ↓
Copy line up / downShift+Alt+↑ / ↓Shift+Option+↑ / ↓
Delete entire lineCtrl+Shift+K⌘+Shift+K
Duplicate lineShift+Alt+DShift+Option+D
Trigger IntelliSenseCtrl+SpaceCtrl+Space
Quick fix / light bulbCtrl+.⌘+.
Indent / outdent lineCtrl+] / [⌘+] / [
Expand/collapse regionCtrl+Shift+[ / ]⌘+Option+[ / ]

Search & Replace

ActionWindows / LinuxMac
Find in fileCtrl+F⌘+F
Find & replace in fileCtrl+H⌘+H
Find in all filesCtrl+Shift+F⌘+Shift+F
Replace in all filesCtrl+Shift+H⌘+Shift+H
Find next / previousF3 / Shift+F3⌘+G / ⌘+Shift+G

Integrated Terminal

ActionWindows / LinuxMac
Toggle terminal panelCtrl+`Ctrl+`
New terminalCtrl+Shift+`Ctrl+Shift+`
Kill terminalCtrl+Shift+5 (in terminal)⌘+Shift+5
Split terminalCtrl+Shift+5⌘+\
Focus next terminalAlt+DownOption+Down
Scroll terminal upCtrl+↑⌘+↑

Debugging Shortcuts

ActionWindows / LinuxMac
Start / continue debuggingF5F5
Stop debuggingShift+F5Shift+F5
Step overF10F10
Step intoF11F11
Step outShift+F11Shift+F11
Toggle breakpointF9F9
Show hover (debug)⌘+K ⌘+I⌘+K ⌘+I

Pro Tips for VS Code Power Users

  • Ctrl+P then type ":" for line jump — quick open accepts filename:linenum so you can type "server.ts:88" and land exactly there.
  • Ctrl+K Ctrl+C / Ctrl+K Ctrl+U — block comment and uncomment entire selections, more reliable than Ctrl+/ for multi-line comments.
  • Shift+Alt+F to auto-format on save — set "editor.formatOnSave": true in your settings and you'll never think about formatting again.
  • Ctrl+Shift+` for a new terminal per task — open one terminal for your dev server, one for git, one for tests. Switch between them without stopping any of them.
  • F12 vs Ctrl+Click — both go to definition, but Ctrl+Click works when the cursor isn't already on the symbol, while F12 works wherever the cursor is.

Download the Developer Shortcuts PDF

The Developer Pack PDF includes complete cheat sheets for VS Code, Vim, IntelliJ IDEA, Cursor, and Chrome — formatted for printing or keeping open on a second monitor. One-time purchase, instant download.

Related Shortcut References

Frequently Asked Questions

What is the single most important VS Code shortcut to learn first?

Ctrl+Shift+P (Cmd+Shift+P on Mac) — the Command Palette. Every VS Code command, setting, and extension action is accessible from here. If you forget a shortcut, open the Command Palette and search for the action by name.

How do I open a file quickly in VS Code without using the file explorer?

Press Ctrl+P (Cmd+P on Mac) to open Quick Open. Start typing the filename and VS Code will fuzzy-search your entire project. Add a colon and line number (e.g. 'app.ts:42') to jump directly to a specific line.

How do I edit multiple lines at the same time in VS Code?

Hold Alt and click to place cursors at multiple positions. Press Ctrl+D to select the next occurrence of the selected text and add a cursor there — repeat to keep selecting more. Press Ctrl+Shift+L to select all occurrences at once.

How do I move a line of code up or down in VS Code?

Press Alt+Up to move the current line up and Alt+Down to move it down. This works on the current line without selecting it first. You can also move multiple selected lines at once with the same shortcut.

What is the VS Code shortcut to comment out code?

Press Ctrl+/ (Cmd+/ on Mac) to toggle a line comment on the current line or all selected lines. Press Ctrl+Shift+A (Cmd+Option+A on Mac) to toggle a block comment around the selection.