BrianHicks / spacemacs-rocks

A tip blog!
http://spacemacs.brianthicks.com
20 stars 3 forks source link

changing things across a search #5

Open BrianHicks opened 9 years ago

BrianHicks commented 9 years ago

Changing all occurrences of a word in a project is pretty easy. e.g. let’s say we want to change every occurrence of spacemacs in the spacemacs source to superspacemacs

  • open any file in the spacemacs source
  • SPC s p spacemacs gives you all occurences
  • C-c C-e goes into edit mode of all the lines your search found
  • You can now edit the buffer freely using e.g. iedit
  • C-c C-c saves your changes across all the files.

@cpaulik, was this you?

cpaulik commented 9 years ago

Yes that was me :smile:

BrianHicks commented 9 years ago

Hmm, this doesn't work for me. When I'm done editing and hit C-c C-c it says that the text is readonly. What do you recommend here, @cpaulik? Does this sound like a bug to you? I am on the develop branch.

cpaulik commented 9 years ago

Hmm, I'm also on develop. I recently learned that this tip only works when searching with helm-ag so not with helm-grep but in helm-grep C-c C-e is not bound so you would have noticed.

How can you edit the text if it is read-only. Have you tried pressing C-x C-q?

fleutot commented 4 years ago

I have this exact behavior, @BrianHicks . What did you do to fix it?

My helm-ag related config:

(setq helm-ag-insert-at-point 'symbol)
(setq helm-ag-ignore-patterns '("build" "vendor" "*/venv/*"))
(global-set-key "\M-s" 'helm-ag-project-root)
BrianHicks commented 4 years ago

I no longer use spacemacs, sorry. You'd have better luck asking in one of their support forums nowadays. 😄

I have had to say this in a couple places recently, so I'm just going to archive this repo—but no hard feelings, and I'm sorry you're having trouble!