⌥+⌃AltPlusCtrl

VS Code Multi-Cursor & Selection Editing Shortcuts

Multi-cursor editing is one of VS Code's most distinctive features and the one experienced users miss the most when forced back into a simpler editor — the ability to make the same edit in several places simultaneously rather than repeating a find-replace or manual edit several times over. Two more selection techniques round out multi-cursor editing: selecting every occurrence of a match at once rather than incrementally, and drawing a genuine rectangular column selection for vertically aligned content.

ActionWindowsMacDescription
Select the current lineCtrl+LCmd+LSelects the entire line the cursor is on, extending to additional lines if pressed repeatedly — a fast way to grab a whole line for deletion or duplication without using Home/Shift+End.
Add cursor on the line below/aboveCtrl+Alt+Down / Ctrl+Alt+UpCmd+Option+Down / Cmd+Option+UpPlants an additional cursor directly one line up or down from wherever you are now, matching the same column — so one typed edit lands identically down a whole vertical stack of lines instead of repeating it manually each time.
Add selection to next matchCtrl+DCmd+DHighlights the word sitting under the cursor first, then each further press hunts down and adds the next matching occurrence to a growing multi-selection — VS Code's go-to move for touching up a handful of variable instances that F2's formal Rename Symbol refactor either can't see or would apply too broadly.
Duplicate line downShift+Alt+DownShift+Option+DownCopies the current line (or full selection spanning multiple lines) and inserts the copy directly below, without needing to select, copy, and paste manually.
Move line up/downAlt+Up / Alt+DownOption+Up / Option+DownPhysically relocates the current line (or selected block) one position up or down, automatically adjusting surrounding indentation-sensitive code correctly in most languages.
Toggle line commentCtrl+/Cmd+/Flips the comment state on the current line or whatever's selected, picking the right comment marker automatically based on the file's detected language rather than requiring you to remember whether it's // or # or something else entirely.
Select all occurrences of current selectionCtrl+Shift+LCmd+Shift+LJumps straight to selecting every matching instance in the file at once, skipping the incremental Ctrl+D approach entirely for cases where you already know every occurrence needs the exact same edit.
Column (box) selectionShift+Alt+dragShift+Option+dragDraws a rectangular box selection spanning multiple lines at the same column range, rather than a normal line-based text selection, useful for editing a vertically aligned block of text like a column of values in an ASCII table or aligned code.
The first Ctrl+D (Cmd+D on Mac) grabs the word sitting under your cursor, and every additional press after that pulls in the next matching occurrence further down the file, building up a multi-selection where each match gets its own independent cursor. Once you've selected exactly the occurrences you want — skipping any you don't want changed by simply not pressing Ctrl+D when the highlight lands on them, or pressing Ctrl+K (in some configurations) to skip the current match and move to the next — you can type a replacement and it applies simultaneously at every selected cursor location. This is the standard VS Code technique for renaming a handful of instances of a name that a formal Rename Symbol refactor (F2) would either over-apply across the whole project or under-apply if the symbol isn't recognized by the language server. Adding cursors vertically (Ctrl+Alt+Down/Up on Windows and Linux, Cmd+Option+Down/Up on Mac) plants an extra cursor one line above or below wherever the current one sits, holding the same column position, which is exactly the tool for touching up a consistent column of values spread across several lines — adding the same prefix to a list of imports, or incrementing a series of numbers that line up vertically. Line-level operations round out the editing toolkit: Shift+Alt+Down (Shift+Option+Down on Mac) duplicates the current line or selection directly below without a manual copy-paste, and Alt+Up/Down physically moves the current line or block up or down, with VS Code automatically adjusting indentation in languages where that matters. Ctrl+/ toggles line comments using whatever comment syntax is correct for the file's detected language — `//` for JavaScript, `#` for Python, and so on — without you needing to remember or type the syntax yourself. A detail worth knowing about Ctrl+D: it only matches exact word boundaries by default, so selecting 'user' won't also select 'username' unless you explicitly broaden the match — this is usually the behavior you want for safe renaming, since it prevents accidentally catching partial-word matches that would corrupt unrelated identifiers. Selecting all occurrences at once (Ctrl+Shift+L / Cmd+Shift+L) skips the incremental Ctrl+D approach entirely, immediately selecting every single match of the currently selected text throughout the file simultaneously — the right choice when you already know with certainty that you want every occurrence changed identically, since it saves the repeated keypresses Ctrl+D would otherwise require to build up to the same full selection one match at a time. Column (box) selection, drawn by holding Shift+Alt (Shift+Option on Mac) while dragging the mouse, creates a genuine rectangular selection spanning a specific column range across multiple lines, rather than VS Code's normal selection model which always selects complete text spans line by line. This is specifically useful for editing vertically aligned content — a column of values in an ASCII-formatted table within a comment, or a series of similarly-indented variable declarations — where you want to insert, delete, or type the same content at the exact same horizontal position across several consecutive lines at once, a genuinely different capability from the word-based multi-cursor selection Ctrl+D provides.