Fork me on GitHub
#spacemacs
<
2019-04-08
>
Daniel Hines21:04:47

How do you search and replace in spacemacs? * works nicely when it’s a symbol, but I want an arbitrary string/regex. I see references to Alt + %, but that only prints “∞” for me.

didibus02:04:47

Hum, I use spacemacs in non evil mode.

didibus02:04:54

So might be different for you

didibus02:04:09

But I do M-x anzu-query-replace

practicalli-john05:04:53

SPC s e will start iedit mode and if you have some text selected it will let you change all instances. You can couple this with SPC n r, where you select a range of text and narrow to just working on that region. SPC n w to widen your narrow and see the whole file again.

Mario C.23:04:01

@d4hines I usually do :%s/<regex>/<regex>/gc the gc flag is global search and asks you to confirm the search & replace.

Mario C.23:04:13

Idk if that helps