SeanPlusPlus
SeanPlusPlus

Reputation: 9033

Atom edit multiple highlight select

Using multiple-highlight-select I can select a single word and all instances will be highlighted. Is there a way to select a word and edit all instances?

Upvotes: 21

Views: 12114

Answers (2)

Alex Svetkin
Alex Svetkin

Reputation: 1409

Instead of boring find-and-replace, you can edit all instances with multi-cursor.

  • Select a word (by double-clicking on it or press CMD + d to select a word under the cursor).
  • Press CTRL+CMD+g to select all occurrences and to create multi-cursor.
  • Type/delete chars — this will affect all occurrences!
  • Press ESC to leave multi-cursor mode.

This works in Atom 1.18.0. On Windows you should use win instead of CMD button.

Upvotes: 19

Fab313
Fab313

Reputation: 2288

You can select several occurrences of the same word using ctrl + d repeatedly, or select all the occurrences by typing alt + F3.

Then just start typing in order to edit all the occurrences at once. (press escape when you are done to return to normal "single" editing)


Otherwise, using ctrl + e when you are on a word will open the find and replace panel for this word.

Then use tab to go into the "replace in current buffer' field, and type your replacement word.

Finally, hit enter to replace the occurrences one by one, or ctrl + enter to replace all.

Upvotes: 10

Related Questions