How to do a project-wide find and replace in Spacemacs?
Asked Answered
S

1

14

I'm trying to do a project-wide find/replace in Spacemacs. I tried this:

  1. SPC s a p
  2. Type the text I want to replace.
  3. C-c C-e

At this point Spacemacs tells me text is read-only. What am I missing to be able to preform the edit operation?

Shererd answered 12/6, 2018 at 18:27 Comment(0)
I
29

Use SPC p R to use projectile-replace which runs interactive query-replace on all files in the project.

Illtimed answered 13/6, 2018 at 18:12 Comment(4)
Thanks for this. It might be worth noting, that the interactive find/replace wont save the buffers. It looks like we can use SPC f S to use evil-write-all for saving all unsaved buffers.Shererd
This really helped me :D sed wasn't enough. Thanks!Curbstone
This was a life saver as I went to fix several imports across 70+ files lol. Thanks!Mellow
SPC p % does the same thing but has regex functionality includedMellow

© 2022 - 2024 — McMap. All rights reserved.