TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Amber: A code search and replace tool

124 pointsby bpierreabout 1 year ago

15 comments

saurikabout 1 year ago
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.
评论 #40459912 未加载
评论 #40458858 未加载
评论 #40458009 未加载
评论 #40463134 未加载
daniloncabout 1 year ago
Reminded me of <a href="https:&#x2F;&#x2F;github.com&#x2F;ast-grep&#x2F;ast-grep">https:&#x2F;&#x2F;github.com&#x2F;ast-grep&#x2F;ast-grep</a> and I wonder how it compares in performance and functionality.
评论 #40455859 未加载
评论 #40460140 未加载
评论 #40456517 未加载
laerusabout 1 year ago
At this rate of naming projects after the same valuable stones, we are going to need namespacing for the CLI tools.
评论 #40458255 未加载
评论 #40460800 未加载
评论 #40456366 未加载
评论 #40460522 未加载
评论 #40457840 未加载
评论 #40459025 未加载
dmixabout 1 year ago
I used to use <a href="https:&#x2F;&#x2F;comby.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;comby.dev&#x2F;</a> which is amazing when it works but I kept having issues where it wouldn&#x27;t accept my input or it&#x27;d error during processing. It was very flaky. So I&#x27;ve resorted to using <a href="https:&#x2F;&#x2F;github.com&#x2F;piranha&#x2F;goreplace">https:&#x2F;&#x2F;github.com&#x2F;piranha&#x2F;goreplace</a> as backup which is much simpler but reliable.<p>I&#x27;ll check this one out...
评论 #40461046 未加载
malthejorgensen12 months ago
Feels similar to `sd` (<a href="https:&#x2F;&#x2F;github.com&#x2F;chmln&#x2F;sd">https:&#x2F;&#x2F;github.com&#x2F;chmln&#x2F;sd</a>)<p>which in my mind was the first “replace” version of ripgrep<p>grep -&gt; ripgrep<p>sed -&gt; sd
js212 months ago
Most of the time if I&#x27;m doing this, it&#x27;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:&#x2F;&#x2F;gist.github.com&#x2F;jaysoffian&#x2F;0eda35a6a41f500ba5c458f02a29865d" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;jaysoffian&#x2F;0eda35a6a41f500ba5c458f02...</a><p>Put it in `PATH` and then: `git gsr &lt;old&gt; &lt;new&gt;`
VagabundoPabout 1 year ago
<a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=40431835">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=40431835</a><p>EDIT: Opps same name different project.
评论 #40466481 未加载
jes5199about 1 year ago
I&#x27;m glad that people make tools like this, but this is a task that I need to do so rarely that I&#x27;m likely to forget it exists, which means that I&#x27;ll likely roll my own (inferior!) version as a one-time thing.
PaulDavisThe1stabout 1 year ago
<p><pre><code> find . [ ... find args ] | sed -e &#x27;s&#x2F;nee\(dl[aeiou]\)&#x2F;stack\1&#x2F;g&#x27;</code></pre>
nathants12 months ago
this is cool! i do the same thing[1], wanted ag&#x2F;rg to be able to search and replace.<p>1. <a href="https:&#x2F;&#x2F;github.com&#x2F;nathants&#x2F;agr">https:&#x2F;&#x2F;github.com&#x2F;nathants&#x2F;agr</a>
Singletonedabout 1 year ago
Can it do multiline search and replace?
评论 #40461062 未加载
Ringzabout 1 year ago
Is it possible to store my config files under ~.config&#x2F;amber&#x2F; on MacOS?
harryquach12 months ago
Not to be confused with this Amber<p><a href="https:&#x2F;&#x2F;amber-lang.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;amber-lang.com&#x2F;</a>
sam0x1712 months ago
not to be confused with Amber, the crystal lang web framework
评论 #40459616 未加载
mceplabout 1 year ago
<a href="https:&#x2F;&#x2F;github.com&#x2F;BurntSushi&#x2F;ripgrep">https:&#x2F;&#x2F;github.com&#x2F;BurntSushi&#x2F;ripgrep</a> ???
评论 #40456056 未加载
评论 #40461081 未加载
评论 #40456074 未加载