Remix.run Logo
themadsens 2 days ago

Whats with all the fuss over multicursor. How is this different from just using '.'

wilkystyle 2 days ago | parent [-]

dot repeat is the wrong comparison. A closer one would be macros, but even then a good multiple cursors implementation is often faster, more intuitive, and requires less cognitive overhead. One of the better examples of the usefulness of multiple cursors is from Emacs Rocks (link goes to 0:23):

https://m.youtube.com/watch?v=jNa3axo40qM&t=23s

themadsens 14 hours ago | parent | next [-]

The dot command, as you probably well know, is a macro that captures the last change: was it '3cw' or 'cE' or '7s' or <visual>s or 'ct)', all changed to the last insert. All intuitively without you even having to think about it.

Much more powerful than "change all my selections to the next input" IMO.

camgunz 2 days ago | parent | prev [-]

What do you when the things you want to change don't all fit on the screen at once?

eviks a day ago | parent | next [-]

That's one challenge I haven't seen editors tackle correctly by, e.g. having some special condensed view where only lined with cursors are shown so you can see more cursors on the screen and easier scroll around to see even more skipping the rest of the text (like some git diff tools do, showing only diffs with minimal context)

So you either cycle through cursors (if your editor has a concept of "primary cursor") to see before/after or you do it blindly and accept a chance to be wrong

suby 5 hours ago | parent [-]

This strikes me as a good idea I've never seen articulated before. Something like a sticky scroll which accrues all off screen cursors, limited to some max to prevent things getting out of hand.

wilkystyle a day ago | parent | prev | next [-]

At least in e.g. Emacs and sublime text, you can mark all occurrences throughout the entire file. Assuming the matches are similar enough that the same motions apply even if you can't see the cursor, you can perform those operations.

Otherwise, as a sibling comment said, incremental search/replace is your friend.

luxurytent a day ago | parent | prev [-]

You do a search/replace which has a similar function, although applied differently.