3

What is the difference between iedit and multiple-cursors?

As far as I can tell they provide basically the same functionality.

5

I never used iedit extensively, so I could be unaware of some of its features, but basically iedit is a more interactive search and replace: you can select occurrences of a string in some scope (region, defun, buffer, etc.) and then replace them with something else.

Compared to that, multiple-cursors generalizes in two directions, the second much more important than the first in my opinion:

  • You are not limited to put cursors just at occurrences of some string. You can put cursors wherever you click the mouse, or at the end of a bunch of lines, or at matches of a regexp, etc., or any combination of these locations.

  • Even if you did choose to place cursors just at occurrences of some string, you are not limited to just replacing them with some other string. You can do any Emacs text editing simultaneously at every location. For example, you could transpose the words found around each cursor, or mark the entire defun containing each cursor and comment it out.

Just as iedit can be thought of as an instant-preview version of query-replace, multiple-cursors can be thought of as an instant-preview version of keyboard macros.

  • 3
    FWIW I use both. In fact, iedit provides iedit-switch-to-mc-mode so you can select something with iedit and then switch to multiple-cursors if you want. I find iedit is what I want most of the time, but mc is very useful for certain situations. – glucas Feb 15 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.