What is the difference between iedit
and multiple-cursors
?
As far as I can tell they provide basically the same functionality.
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityI 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.
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.
C-M-u
to move outside of the sexp containing each match and do something to it. So it definitely cannot substitute for all uses of multiple-cursors. If your marked regions in iedit contain two words, you can certainly tranpose them in all region at the same time, but you can't for example, transpose the last word in each region with the first word after the region. So it doesn't really have all the capabilities of multiple cursors.