Skip to content

Multi-Cursor Editing: A Complete Guide

There are two kinds of text editor users: those who discovered multi-cursor editing and immediately thought "why didn't I know about this sooner," and those who still haven't discovered it yet. Multi-cursor editing is one of the highest-leverage features in a modern text editor — it can reduce what would be fifty identical manual edits into five seconds of work, and it fundamentally changes how you think about structured text manipulation.

This guide covers the full picture: what multi-cursor editing is, the three main methods for adding cursors, the complete shortcut reference for ZITEXT (alongside VS Code and Sublime Text for comparison), column selection, and advanced workflows that turn multi-cursor from a novelty into a core daily tool.

What Is Multi-Cursor Editing and Why Does It Matter?

In a standard text editor, you have one cursor. You type, the cursor advances, you move the cursor, you type again. Everything is sequential. If you need to make the same change in 40 places in a file — say, adding a property to every object in a JSON array, or wrapping every URL in a list with quotes — you either use Find & Replace, write a macro, or do it by hand.

Multi-cursor editing gives you simultaneous insertion points. Every cursor in the editor acts independently for cursor movement, but types the same characters simultaneously. You can have 2 cursors or 200; each one inserts, deletes, selects, and moves in sync with the others.

Consider renaming a variable throughout a function. Without multi-cursor, you'd use Find & Replace — which works, but it requires switching mental modes, typing the search term, typing the replacement, confirming. With multi-cursor, you select the first instance, add cursors on each subsequent instance with Cmd+D (or Ctrl+D on Linux/Windows), and type the new name directly. The whole operation takes three seconds without leaving the editing context.

Beyond speed, multi-cursor editing changes the nature of certain edits. Instead of thinking "I need to find all these instances and replace them," you start thinking "I can just select all these simultaneously and type." This mental shift — from search-and-replace to direct simultaneous manipulation — is what makes multi-cursor a genuine productivity multiplier rather than just a clever trick.

Adding Cursors: The Three Main Methods

Multi-cursor support in modern editors converges on three primary methods for placing additional cursors, each suited to different situations.

Method 1: Click to place

Hold Alt (or Option on Mac) and click anywhere in the document to place an additional cursor at that position. This is the most flexible method — you can place cursors exactly where you need them regardless of whether those positions share any textual relationship. It's ideal for ad-hoc edits where the positions you need to change are visually scattered across the document.

The limitation is precision. If you need to add cursors to 30 lines, clicking each one individually takes time. The other two methods scale better.

Method 2: Match selection (select-next)

Select a word or phrase, then press Cmd+D / Ctrl+D repeatedly. Each press selects the next occurrence of that exact text and adds a cursor at the end of the selection. Continue pressing until you've selected all instances you want to edit simultaneously.

This is the most commonly used method because it matches the natural workflow: you see a token you want to rename or modify, select it, then expand the selection to all instances. Press Cmd+Shift+L / Ctrl+Shift+L to immediately select all occurrences without pressing Cmd+D repeatedly.

Method 3: Keyboard-only cursor placement

Hold Cmd+Alt (Mac) or Ctrl+Alt (Linux/Windows) and press the Up or Down arrow keys. This places additional cursors on the lines above or below the current cursor position, aligned to the same column. This method is perfect for adding the same content to a sequence of consecutive lines — prefixing lines, adding trailing commas, or editing aligned data structures.

This is the gateway into column selection, which gets its own section below.

Multi-Cursor Shortcuts in ZITEXT

ZITEXT is built on Monaco Editor, which uses VS Code-compatible keybindings by default. This means the shortcut muscle memory you've built in VS Code transfers directly. The table below covers the essential multi-cursor shortcuts alongside their equivalents in VS Code and Sublime Text:

Action ZITEXT (Mac) ZITEXT (Win/Linux) VS Code shortcut Sublime shortcut
Add cursor above Cmd+Alt+↑ Ctrl+Alt+↑ Ctrl+Alt+↑ Ctrl+Alt+↑
Add cursor below Cmd+Alt+↓ Ctrl+Alt+↓ Ctrl+Alt+↓ Ctrl+Alt+↓
Add cursor at click Alt+Click Alt+Click Alt+Click Ctrl+Click
Select next occurrence Cmd+D Ctrl+D Ctrl+D Ctrl+D
Select all occurrences Cmd+Shift+L Ctrl+Shift+L Ctrl+Shift+L Alt+F3
Skip next occurrence Cmd+K, Cmd+D Ctrl+K, Ctrl+D Ctrl+K, Ctrl+D
Column (box) select Shift+Alt+Drag Shift+Alt+Drag Shift+Alt+Drag Shift+RMB drag
Undo last cursor Cmd+U Ctrl+U Ctrl+U Ctrl+U
Dismiss all extra cursors Escape Escape Escape Escape
Add cursors to line ends Shift+Alt+I Shift+Alt+I Shift+Alt+I
Tip: Cmd+U / Ctrl+U is the "undo last cursor" shortcut — not undo typing. It removes the most recently added cursor from the selection, letting you back out of accidentally selecting an occurrence you didn't want without starting over.

Column Selection: Editing Rectangular Blocks of Text

Column selection (also called box selection or rectangular selection) is a specific pattern of multi-cursor usage that treats a rectangular block of text as a single selection, regardless of line content. It's one of the most powerful tools for working with structured, columnar data.

To use column selection in ZITEXT, hold Shift+Alt and drag the mouse across the region you want to select. A rectangular highlight appears that spans all lines in the drag area. When you type, all selected positions are edited simultaneously.

A practical example: suppose you have a list of CSS variables that need a prefix added:

--color-primary: #2563eb;
--color-secondary: #64748b;
--color-accent: #0ea5e9;
--color-surface: #f8fafc;
--color-border: #e2e8f0;

To change --color- to --brand-color- on every line, you would:

  1. Click at the start of color on the first line
  2. Hold Shift+Alt and drag down to the end of color on the last line
  3. All five instances of color are now selected simultaneously
  4. Type brand-color to replace all at once

Column selection also works with the keyboard. Holding Shift+Alt while pressing arrow keys extends a column selection one character or one line at a time — useful for precise selection without a mouse.

Another powerful use case is extracting columns from aligned data. Log files, TSV/CSV-like text, and aligned configuration files can all be manipulated with column selection in ways that Find & Replace can't handle cleanly. Select only the value column, copy it, paste it into a spreadsheet or another file. No regex, no scripting.

Combining Multi-Cursor with Find & Replace

Multi-cursor and Find & Replace are not competing approaches — they're complementary, and the most productive workflow combines them strategically.

Find & Replace is better when:

  • The occurrences are spread across many files (multi-file replace)
  • You need a regex transformation — changing the shape of the match, not just replacing it verbatim
  • The occurrences number in the hundreds and visual confirmation of each is impractical

Multi-cursor is better when:

  • You need to confirm each occurrence visually before editing it
  • The edits are not uniform replacements — you want to type around the selected text, or apply different transforms that aren't expressible in a single regex
  • The change is within a single file and you want to stay in editing flow without switching to a dialog

The "select all occurrences" feature (Cmd+Shift+L) bridges the two: it uses the search engine to find all matches but then gives you simultaneous cursors at each one, so you're editing directly rather than filling in a find/replace dialog.

For regex-powered multi-edit: use Find (Cmd+F / Ctrl+F) with the regex toggle enabled to locate all matches, then press Alt+Enter to convert all matches to cursors. This is one of the most powerful combinations in the editor — regex to define the pattern, multi-cursor to do the editing.

Advanced Workflows: When Multi-Cursor Saves Hours

Here are five real-world scenarios where multi-cursor editing provides dramatic time savings over conventional approaches.

Refactoring object properties across a data file

You have a JSON file with 60 objects, each with a createdAt field that needs to be renamed to created_at. Select createdAt, press Cmd+Shift+L to select all 60 instances simultaneously, and type created_at. Done in five seconds — versus manually editing each occurrence or writing a temporary script.

Adding a parameter to function calls

A function signature changed to require an additional argument: authenticate(user) becomes authenticate(user, context). Select the closing parenthesis of authenticate( occurrences using Cmd+D to step through each call site, then type , context to add the argument. Skip any false-positive matches with Cmd+K, Cmd+D.

Transforming a list into an array

You have a plain list of items (one per line, copied from a spreadsheet or email) that needs to become a JavaScript or Python array. Select all lines, use Shift+Alt+I to place a cursor at the end of every line, type ,, then go to line starts and add quotes. The entire transformation — adding opening quotes, closing quotes, and commas — can be done in three multi-cursor operations.

// Starting with:
apple
banana
cherry

// Using multi-cursor at line starts and ends, transform to:
"apple",
"banana",
"cherry"

Aligning code for readability

When declaring several related constants, you may want to align the = signs for readability. Column selection and multi-cursor let you insert spaces precisely at each line's specific position — something that's impossible with a single cursor and tedious even with Find & Replace.

Building repetitive HTML structures

When generating table rows, list items, or repeated markup from a set of values, multi-cursor lets you edit the structure and content simultaneously. Write the template on one line, duplicate the line for each item, use multi-cursor to replace the placeholder content on each line. This is faster than a template engine for quick one-off HTML construction tasks.

Multi-cursor editing rewards practice. The first few times you use it, you'll be slow — consciously remembering shortcuts and thinking through the sequence of operations. Within a few days of regular use, the patterns become automatic. You'll start seeing editing tasks differently: instead of "I need to change these 20 things," you'll immediately recognize "this is a two-second multi-cursor operation."

The investment in learning these shortcuts pays compounding returns every single day you write code or edit structured text.

Try ZITEXT free

Available for macOS, Windows, and Linux. No account required.

Download ZITEXT