Iedit

Mbork has posted a sequel to his highlighting post that I wrote about before. This time he discusses iedit. Mbork says you can think of it as Hi Lock mode with the added capability of editing all the highlighted entries at once. I usually think of it as an alternative to Magnar Sveen’s multiple cursors.

If you want to see the power of iedit take a look at abo-abo’s refactoring workflow. The basic idea is to use rgrep to find every occurrence of a variable, enable editing of the grep output with wgrep, and then change every occurrence of the variable (in the grep output) with iedit. Abo-abo says that he thinks of iedit as a drop in replacement for occur and query-replace.

As mbork mentions in his post, the selection criteria in iedit are very flexible and require a bit of care. Mostly this is because iedit will place symbol bounds around the current symbol. The easy way to get all matching strings is to just mark the string you want to match.

It also behaves differently when given prefix arguments. You can, for example, restrict its action to the current function or cause it to use the same occurrence as the last time it was used in the current buffer. See the built-in help for the details.

This entry was posted in General and tagged . Bookmark the permalink.