Our great sponsors
-
ripgrep
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
The shell function from this comment works pretty well for me: https://github.com/BurntSushi/ripgrep/issues/152#issuecommen...
I wanted to like sd but it doesn't support my main use case of recursive search/replace. Imagine every time you wanted to grep some files you had to build a find+xargs+rg pipeline... it just takes me out of the flow too much. I'm glad people are posting other options here, I'm looking forward to trying them.
https://github.com/chmln/sd/issues/62
Thanks for the pointer. There are definitely a few tools that have explored the idea of searching the AST of code. Semgrep seems to do that, as does a tool called ast-grep [0].
Both of them are sort of doing the opposite of my tool. They are letting you specify your search as a chunk of code/AST.
My tool let's you grep a regex as usual, but shows you the matches in a helpful AST aware way.
[0] https://ast-grep.github.io/
Recently I have also used [ambr](https://github.com/dalance/amber) which can do both search (ambs) and replace (ambr) recursively in your codebase. The only problem as of yet is that it does not support globbing so I cannot filter on certain filetypes only.
I’ll also throw in Leah Neukirche ‘s xe as a better alternative to xargs: https://github.com/leahneukirchen/xe
[0] https://github.com/paul-gauthier/grep-ast
Related posts
- Ugrep – a more powerful, ultra fast, user-friendly, compatible grep
- Potencializando Sua Experiência no Linux: Conheça as Ferramentas em Rust para um Desenvolvimento Eficiente
- Ripgrep is faster than {grep, ag, Git grep, ucg, pt, sift}
- Broot: A new way to look at file management written in Rust
- How can someone who has primarily worked in Web/Mobile development break into systems engineering?