Best for · AI tools

VS Code multiple cursors: every shortcut, and when to use which

We read every plan page. Paid links are labelled. Money never changes a ranking. How we pick.

Verdict Our pick

The bar guide has a call.

The vectaai bar guide pointing at the verdict
  • the tool by job: Ctrl+D when you want to choose matches one by one, Ctrl+Shift+L when every match should change, Shift+Alt+I for the end of every selected line, and Shift+Alt plus a mouse drag for a box of text.

Compared here

  • 01Alt+Click
  • 02Ctrl+D / Cmd+D
  • 03Ctrl+Shift+L / Shift+Cmd+L
  • 04Shift+Alt+I
  • 05Column (box) selection
  • 06Ctrl+U / Cmd+U

Short answer

To get multiple cursors in VS Code, hold Alt (Option on Mac) and click wherever you want an extra cursor. From the keyboard: Ctrl+Alt+Down or Up on Windows (Option+Cmd+Down or Up on Mac, Shift+Alt+Down or Up on Linux) adds a cursor on the next or previous line, Ctrl+D (Cmd+D on Mac) grabs the next match of the selected word, and Ctrl+Shift+L (Shift+Cmd+L) puts a cursor on every match at once. Made a mess? Ctrl+U (Cmd+U) undoes the last cursor, and Escape drops back to one.

Pick the tool by job: Ctrl+D when you want to choose matches one by one, Ctrl+Shift+L when every match should change, Shift+Alt+I for the end of every selected line, and Shift+Alt plus a mouse drag for a box of text. For renaming a variable in real code, F2 (Rename Symbol) is safer than any cursor trick. All keys below are quoted from Microsoft's VS Code docs, read 4 December 2026.

At a glance

Default keys quoted from code.visualstudio.com Basic editing and Default keyboard shortcuts pages, read 4 December 2026. Your keys can differ if you changed keybindings or installed a keymap extension.
What you wantWindowsmacOSLinuxCommand ID
Add a cursor where you clickAlt+ClickOption+ClickAlt+Click(mouse gesture)
Add a cursor on the line belowCtrl+Alt+DownOption+Cmd+DownShift+Alt+Downeditor.action.insertCursorBelow
Add a cursor on the line aboveCtrl+Alt+UpOption+Cmd+UpShift+Alt+Upeditor.action.insertCursorAbove
Select the next matchCtrl+DCmd+DCtrl+Deditor.action.addSelectionToNextFindMatch
Skip this match, take the next oneCtrl+K Ctrl+DCmd+K Cmd+DCtrl+K Ctrl+Deditor.action.moveSelectionToNextFindMatch
Cursor on every matchCtrl+Shift+LShift+Cmd+LCtrl+Shift+LCheck in the Keyboard Shortcuts editor
Change all occurrences of the wordCtrl+F2Cmd+F2Ctrl+F2editor.action.changeAll
Cursor at the end of each selected lineShift+Alt+IShift+Option+IShift+Alt+Ieditor.action.insertCursorAtEndOfEachLineSelected
Select all matches from the Find boxAlt+EnterOption+EnterAlt+Entereditor.action.selectAllMatches
Undo the last cursorCtrl+UCmd+UCtrl+UcursorUndo
Box (column) selectionShift+Alt+dragShift+Option+dragShift+Alt+drag(mouse gesture)

Multiple cursors are the single most useful trick in VS Code that most people learn by accident. You hold a key, click, and suddenly you are typing in five places at once. It feels like magic the first time and like a loaded gun the second, when you realise you just changed a word in forty places, including three you did not mean.

So here is the whole thing in one place: every way to add cursors, the keys for Windows, Mac and Linux, a few real jobs it saves you time on, the settings worth changing, and the times you should put the cursors down and use something safer. Every shortcut on this page comes from Microsoft's own VS Code documentation, read on 4 December 2026. We did not invent any, and we did not dress anything up as a "test". It is a text editor feature. It works or it does not.

The two-second answer

Hold Alt (Windows, Linux) or Option (Mac) and click. Every click adds a cursor. Type, and the text appears at every cursor. Press Escape to go back to one.

Microsoft puts it plainly: "Each cursor operates independently based on the context it sits in." That last part matters. If you press Ctrl+Right Arrow with three cursors, each one jumps to the end of its own word, not the same distance. That is why multi-cursor editing works on lines of different lengths.

Every way to add a cursor

There are five main routes. Learn two of them well and you will use the rest once a month.

1. Mouse: Alt+Click. The slow and precise way. Good for three or four scattered spots.

2. Line above or below. Windows: Ctrl+Alt+Down or Up. Mac: Option+Cmd+Down or Up. Linux: Shift+Alt+Down or Up. Linux gets different keys on purpose, so do not panic when the Windows combo does nothing there. Hold the key and tap the arrow a few times and you get a straight vertical line of cursors.

3. Next match: Ctrl+D (Cmd+D). Select a word, or just put the cursor in it, and press Ctrl+D. VS Code selects it. Press again and it adds the next match. Again, the next one. If one of the matches is wrong, press Ctrl+K Ctrl+D (Cmd+K Cmd+D) to skip it and jump to the next. This is the one you will use most, because you stay in control of every match.

4. Every match: Ctrl+Shift+L (Shift+Cmd+L). Same idea, no asking. A cursor lands on every match of the selection in the file. There is also Ctrl+F2 (Cmd+F2), listed as Change all occurrences, which does much the same for the current word. Fast and dangerous in equal measure. More on that below.

5. From the Find box: Alt+Enter (Option+Enter). Press Ctrl+F, type a search, even a regular expression, then Alt+Enter. You get a cursor on every match of the search. This is the grown-up version of Ctrl+Shift+L, because you control the pattern exactly.

And one bonus that saves real time: Shift+Alt+I (Shift+Option+I on Mac). Select a block of lines, press it, and you get a cursor at the end of each line. Perfect for adding a comma, a semicolon or a closing quote to twenty lines.

Box selection: editing a column

Sometimes the text you want sits in a neat column: the second word of every line, a list of values, a table. That is box selection, also called column selection.

Click at one corner, hold Shift+Alt (Shift+Option on Mac), and drag to the opposite corner. You get a rectangle, with a cursor on each line inside it. If you switched the multi-cursor key to Ctrl (see settings below), the drag becomes Shift+Ctrl or Shift+Cmd instead.

There are keyboard commands for column selection too (cursorColumnSelectDown, Up, Left, Right and the Page versions). Microsoft says they have default shortcuts on macOS and Windows, "but not on Linux", so Linux users bind their own. If you do a lot of column work, there is also a Column Selection Mode toggle in the Selection menu; while it is on, ordinary mouse drags and Shift+arrow keys make boxes instead of normal selections. It also shows in the Status bar, which is where you turn it off when you forget you left it on. Everybody forgets once.

Fixing mistakes: Ctrl+U and Escape

Added one cursor too many? Press Ctrl+U (Cmd+U). That command is called Undo last cursor operation, and it removes just the latest cursor, not your text edits. Press it again to step back further. Escape throws away every extra cursor at once.

The difference matters with Ctrl+D. Pressed it one time too many and grabbed a match you did not want? Ctrl+U steps back one. Escape makes you start over.

Five real jobs where multiple cursors save time

Add a comma to the end of 30 lines. Select the lines, press Shift+Alt+I, press End if needed, type the comma. Done in two seconds.

Wrap a list of words in quotes. Turn a plain list into "apple", "pear", "plum". Select the lines, Shift+Alt+I for a cursor at each line end, type the closing quote and comma, press Home to jump to each line start, type the opening quote. Because each cursor moves on its own line, Home and End work per line.

Rename one word inside a single function. Click the word, press Ctrl+D a few times until you have the ones inside that function, then type. You stop when you reach the function's end, so nothing outside changes. Skip a false match with Ctrl+K Ctrl+D.

Edit a column in a text table or CSV. Box select the column with Shift+Alt and drag, then type over it. Watch out with CSV lines of uneven length: a box is a box, so it only lines up when your columns line up.

Paste a list into many places. Copy five lines, make five cursors, paste. Microsoft's docs explain the setting behind this: with editor.multiCursorPaste at its default, spread, each copied row goes to its own cursor in order. Set it to full and every cursor gets the whole text instead.

Settings worth knowing

Open Settings and search for these:

  • editor.multiCursorModifier. The default is alt. Set it to ctrlCmd and adding cursors becomes Ctrl+Click (Cmd+Click on Mac). People coming from Sublime Text or other editors often prefer that. VS Code then moves Go to Definition and Open Link to Alt+Click so they do not clash. The Selection menu has a quick switch for this too.
  • editor.multiCursorPaste. spread (default) or full, as explained above.
  • Editor: Column Selection. Turns Column Selection Mode on by default. Most people want this off.

To change any shortcut, open the Keyboard Shortcuts editor with Ctrl+K Ctrl+S (Cmd+K Cmd+S on Mac), search the command ID from the table above, and record a new key.

When the shortcuts do not work

The most common complaint: Ctrl+Alt+Down does nothing, or flips the screen upside down. Microsoft's docs say it directly: "Your graphics card driver (for example NVIDIA) might overwrite these default shortcuts." The driver grabs the keys before VS Code sees them. Either turn off the hotkeys in the driver's settings or rebind insertCursorBelow and insertCursorAbove to something free.

Second most common: you are on Linux and using the Windows keys. Linux defaults are Shift+Alt+Down and Up for adding cursors, and there are no default column-selection keys at all.

Third: you installed a keymap extension (Vim, Sublime, IntelliJ keys and friends). Those change the defaults. The Keyboard Shortcuts editor shows what is actually bound right now. Trust that over any blog post, this one included.

When NOT to use multiple cursors

Here is the honest part. Multi-cursor is a text tool. It knows nothing about your code.

If you want to rename a variable, function or class across a project, use Rename Symbol (F2). Microsoft's refactoring docs call it a separate command, and note that "some languages support renaming a symbol across files". It understands the code, so it will not rename the word "count" inside a comment or a string where it means something else. Ctrl+Shift+L will, happily.

If the change spans many files, use Search and Replace across files from the Search view and review the preview before you hit Replace All.

And if the pattern is complicated, a regular expression in the Find box plus Alt+Enter beats clicking around by hand.

Multiple cursors in AI code editors

Most of the popular AI code editors are built on the same open-source base as VS Code, so the multi-cursor keys mostly carry over. Mostly. Each one adds its own AI shortcuts, and some of those reuse keys like Ctrl+K. If a chord like Ctrl+K Ctrl+D behaves strangely in one of them, check its Keyboard Shortcuts editor the same way as above. Our Cursor vs VS Code comparison covers what the paid editor adds on top, and the best AI model for coding covers the models behind them. If you live in the terminal instead, see Claude Code in the terminal vs VS Code.

A last word of advice. An AI assistant can rewrite thirty lines for you, but for a change you can see with your own eyes, like adding commas to a list, multiple cursors are faster, free, and they never invent a line you did not ask for. Learn Ctrl+D, Shift+Alt+I and Ctrl+U today. That covers most of the job.

More tools for writing and coding live on our AI tools hub.

Questions people ask

How do I add multiple cursors in VS Code?

Hold Alt and click on Windows or Linux, or hold Option and click on a Mac. Every click adds another cursor and each one types independently. From the keyboard, Ctrl+Alt+Down on Windows, Option+Cmd+Down on Mac or Shift+Alt+Down on Linux adds a cursor on the next line. Press Escape to go back to a single cursor.

How do I select all occurrences of a word in VS Code?

Put the cursor on the word, or select it, and press Ctrl+Shift+L on Windows and Linux or Shift+Cmd+L on Mac. VS Code puts a cursor on every match in the file. If you want to pick them one by one instead, press Ctrl+D (Cmd+D) repeatedly, and Ctrl+K Ctrl+D to skip one you do not want.

Why does Ctrl+Alt+Down not add a cursor?

Microsoft's docs warn that a graphics card driver, NVIDIA for example, might take over those default shortcuts. On Linux the default is Shift+Alt+Down, not Ctrl+Alt. Open Keyboard Shortcuts with Ctrl+K Ctrl+S (Cmd+K Cmd+S on Mac), search insertCursorBelow and bind it to keys nothing else uses.

How do I change multi-cursor from Alt+Click to Ctrl+Click?

Change the editor.multiCursorModifier setting from alt, the default, to ctrlCmd. That makes it Ctrl+Click on Windows and Linux and Cmd+Click on Mac. The Selection menu also has an item to switch. With ctrlCmd set, Go to Definition and Open Link move to Alt+Click so the two do not fight.

How do I remove one extra cursor in VS Code?

Press Ctrl+U on Windows and Linux or Cmd+U on Mac. That is the Undo last cursor operation command, so it removes the cursor you added most recently and keeps the rest. Press it again to step back further. Escape removes every extra cursor at once and leaves only the main one.

How do I edit a column of text in VS Code?

Click at one corner, hold Shift+Alt (Shift+Option on Mac) and drag to the opposite corner. You get a cursor on every line inside that box. If you set the multi-cursor modifier to ctrlCmd, the gesture becomes Shift+Ctrl or Shift+Cmd. You can also turn on Column Selection Mode from the Selection menu.

Sources

Every fact above comes from these pages. Prices change, so each one carries the date we read it.

  1. Visual Studio Code docs: Basic editing (multiple selections, column selection), checked 4 Dec 2026
  2. Visual Studio Code docs: Default keyboard shortcuts reference, checked 4 Dec 2026
  3. Visual Studio Code docs: Keyboard shortcuts (open and change keybindings), checked 4 Dec 2026
  4. Visual Studio Code docs: Refactoring (Rename Symbol, F2), checked 4 Dec 2026