Hacker News new | ask | show | jobs
by kemayo 806 days ago
It doesn't have to be identical. For the method they're describing you just have to get search results -- so you can use regex in that. You can also just command-click anywhere you want to leave a new selection-point. (Or use various other find commands that search for things and add them to your selection pool.)

The benefit of it is that you're left with a cursor in each location, and you can then do absolutely anything that you'd normally do with a single cursor in every place at once. This includes things like copy/paste, which will maintain a separate buffer in each selection. This also includes things that're actually tough to do with normal find/replace -- I could select the bit after a search result and switch it to title-case, for instance.

You can do most things you'd use it for with find/replace. But sometimes it's easier to watch it happen as you type, rather than construct a fairly complex regex with groups and suchlike.