Fork me on GitHub
#spacemacs
<
2018-05-18
>
spfeiffer11:05:57

How do you do project wide search-and-replace? I found different ways, and all are not working (well): I did SPC / with my search term, get the results in helm buffer. Then c-c c-e is supposed to open the result in an editable buffer, but i get "c-c c-e is undefined". I also tried c-z in the Helm buffer which gives me a menu with F-key assignments, and F4 is supposed to be named "Edit in buffer", but it is not, F4 does an open file in other window. F3 is named „Copy to buffer“, but that is read-only and the wrong thing, i think. Then there is SPC p % which works, but when i am asked to confirm the first replace and i want to replace all occurences with ´!´, i get some cryptic "out of range" error. The only thing that worked was confirming every single occurance.

spfeiffer11:05:31

Now my colleagues with other editors are laughing at me and i am deeply depressed :white_frowning_face:

spfeiffer11:05:40

Using dev branch (0.300)

troglotit12:05:14

I’ve updated just right now and everything works (it worked before too)

troglotit12:05:41

maybe you’ve forgotten to update packages?

spfeiffer12:05:59

What works? c-c c-e in helm buffer?

troglotit12:05:56

that and SPC p %

spfeiffer12:05:32

You are right in that i did not update recently.

spfeiffer12:05:13

Should have tried that.

spfeiffer12:05:58

Nope. Newest dev branch, all packages updated: SPC / <search term> gives me results, then c-c c-e gives me "c-c c-e is undefined"

spfeiffer12:05:53

The helm help c-c ? also does not list c-c c-e in its key map…

spfeiffer12:05:25

Regarding SPC p % i did it wrong: Y does the global replacement, not !. That was my fault. So SPC p % works fine.

theeternalpulse22:05:12

@spfeiffer tried projectile replace?

theeternalpulse22:05:47

SPC p P by default for me projectile-replace is the command

spfeiffer11:05:18

If someone tries this: For me it is bound to SPC p R

spfeiffer11:05:27

And works great!

theeternalpulse21:05:20

I'm sorry, I meant that. the typo escaped me

theeternalpulse21:05:11

glad it works. I also use SPC f S to save all the changes. I tend to use magit to review them if it's available as well

theeternalpulse22:05:15

it's a bit basic, and you'd have to :wa after but I find it the safest to do a project wide search and replace