I don't understand what makes this a "code" search and replace tool as opposed to a general text search and replace tool (a la the many many existing options for such). I was kind of expecting some kind of AST structure or grammar spec or at least a quick tokenizer to be able to handle situations like "don't replace this text if it appears in a string constant", but it doesn't mention anything like that.
Reminded me of <a href="https://github.com/ast-grep/ast-grep">https://github.com/ast-grep/ast-grep</a> and I wonder how it compares in performance and functionality.
I used to use <a href="https://comby.dev/" rel="nofollow">https://comby.dev/</a> which is amazing when it works but I kept having issues where it wouldn't accept my input or it'd error during processing. It was very flaky. So I've resorted to using <a href="https://github.com/piranha/goreplace">https://github.com/piranha/goreplace</a> as backup which is much simpler but reliable.<p>I'll check this one out...
Feels similar to `sd` (<a href="https://github.com/chmln/sd">https://github.com/chmln/sd</a>)<p>which in my mind was the first “replace” version of ripgrep<p>grep -> ripgrep<p>sed -> sd
Most of the time if I'm doing this, it's in a git repo and I only want to affect the checked-in files so that I can easily diff my changes. So I use a combination of `git grep`, `xargs`, and `perl` via a script I named `git-gsr`:<p><a href="https://gist.github.com/jaysoffian/0eda35a6a41f500ba5c458f02a29865d" rel="nofollow">https://gist.github.com/jaysoffian/0eda35a6a41f500ba5c458f02...</a><p>Put it in `PATH` and then: `git gsr <old> <new>`
<a href="https://news.ycombinator.com/item?id=40431835">https://news.ycombinator.com/item?id=40431835</a><p>EDIT: Opps same name different project.
I'm glad that people make tools like this, but this is a task that I need to do so rarely that I'm likely to forget it exists, which means that I'll likely roll my own (inferior!) version as a one-time thing.
this is cool! i do the same thing[1], wanted ag/rg to be able to search and replace.<p>1. <a href="https://github.com/nathants/agr">https://github.com/nathants/agr</a>