← All articles
Sublime Text · Developer Tools

Multi-Select and Multi-Edit in Sublime Text

Sublime Text supports multiple selections, allowing the same edit to be applied to several occurrences at once. This is useful for repetitive changes that are too small for a scripted transformation but tedious to make one by one.

For example, suppose a document contains -test in several places and those selected occurrences need to become -prod.

Select All Matching Occurrences

  1. Open the document in Sublime Text.
  2. Select one occurrence of the text, such as -test.
  3. Use the select-all-occurrences shortcut:
    • macOS: Command + Control + G
    • Windows: Alt + F3
  4. Sublime Text highlights the matching occurrences and creates a cursor/selection for each one.
  5. Replace the selected text with the new value, such as -prod.

All active selections are edited together.

Version context: These shortcuts reflect Sublime Text 3. Current key bindings can vary by platform, version, and user configuration.

Takeaway

Multi-edit is especially useful for small, controlled changes where you want to review each selected occurrence visually before applying the edit. For broad or pattern-based replacements, regular-expression search and replace may be more appropriate.

CONTINUE READING

Explore closely related architecture, integration and implementation topics.