Andrew sets an extremely high bar for open-source engineering. As a loose member of the broader Rust community, I've benefited enormously not only from his code but also from his discussion comments and his blog posts (especially [1] and [2]).<p>Congratulations on the release, Andrew! I also notice that you've joined Astral [3], which as a fan of Rust/Ruff/rg I'm thrilled about.<p>[1]: <a href="https://blog.burntsushi.net/transducers/" rel="nofollow noreferrer">https://blog.burntsushi.net/transducers/</a><p>[2]: <a href="https://blog.burntsushi.net/foss/" rel="nofollow noreferrer">https://blog.burntsushi.net/foss/</a><p>[3]: <a href="https://github.com/astral-sh">https://github.com/astral-sh</a>
There is a distinct joy in showing someone rg who has never seen it before and then seeing them immediately adopt it as a daily tool.<p>Recently a colleague had a bug. He told me it was related to the "X" that was weirdly behaving like a "Y".<p>I fd'd "X" and then rg'd the resulting files for "Y" and found a place where some copy/pasted code was treating "X" as a "Y". Big monorepo codebase, absolutely just tore through it and solved the entire bug.
If you are an Emacs user like me, you <i>must</i> try out the consult-ripgrep command from the peerless Consult [1] package by Daniel Mendler: search your whole project with ripgrep and get a live preview of every matching candidate all inside of Emacs!<p>[1]: <a href="https://github.com/minad/consult">https://github.com/minad/consult</a>
Ripgrep is probably my favorite command line tool (which replaces older solutions). It’s just so quick to search a folder for a specific line of text in a file.
My muscle memory is still dialed in to `ack`, but I recently built an open source tool called `grep-ast` [0] that serves a similar function to ripgrep, ack, etc. The difference is that it shows matching lines in the context of the functions/methods/classes/etc that contain them.<p>It uses the abstract syntax tree (AST) of the source code to show how the matching lines fit into the code structure. It shows relevant code from every layer of the AST, above and below the matches.<p>It feels quite useful when you're grepping to understand how functions, classes, variables etc are used within a non-trivial codebase.<p>Here's a snippet that shows grep-ast searching the django repo. Notice that it finds `ROOT_URLCONF` and then shows you the method and class that contain the matching line, including a helpful part of the docstring. If you ran this in the terminal, it would also colorize the matches.<p><pre><code> django$ gast ROOT_URLCONF
middleware/locale.py:
│from django.conf import settings
│from django.conf.urls.i18n import is_language_prefix_patterns_used
│from django.http import HttpResponseRedirect
⋮...
│class LocaleMiddleware(MiddlewareMixin):
│ """
│ Parse a request and decide what translation object to install in the
│ current thread context. This allows pages to be dynamically translated to
│ the language the user desires (if the language is available).
⋮...
│ def process_request(self, request):
▶ urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
</code></pre>
[0] <a href="https://github.com/paul-gauthier/grep-ast">https://github.com/paul-gauthier/grep-ast</a>
rg is great, I use it a lot.
Recently I have also used [ambr](<a href="https://github.com/dalance/amber">https://github.com/dalance/amber</a>) 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 use Ripgrep daily, and it helps me a lot when navigating codebases, and I even use it to search through my notes. A while ago, I made a script that looks for file paths in the output from Ripgrep in order to turn the paths into clickable links, as I couldn't get it to work properly back then. I'm so happy to hear that «the headlining feature in this release is hyperlink support»! I'm really looking forward to using the new update.
The notes state that the headline feature is "hyperlink support". However, the notes don't seem to really explain what that means. Can someone explain a bit more about what that feature does/is? What's a use case?
Extra life hack for Mac users — you can use mdfind first and then pipe those results into rg with xargs. Even faster. Mdfind has an index already so the results are almost instant even across huge numbers of files. Major qol improvement.
I'm still sad that --sort-files makes ripgrep run in single-core mode. (I know you can't make --sort-files _free_ in multi-core mode, but it would still be faster than single-core)<p><a href="https://github.com/BurntSushi/ripgrep/issues/152">https://github.com/BurntSushi/ripgrep/issues/152</a>
I don't seem to get the hyperlinks with either Terminal or iTerm.<p>P.S. OK found it: it can't show hyperlinks when you explicitly pass a file name to search (for internal implementation reasons, might be fixed later). It works when you search in directories etc.
Hyperlink support? Hell yes! This has been such a frustration of using terminal tools to search in files. I love that the vscode format even linkifies by matched line. Thanks for this update burntsushi!
Ripgrep is an essential tool for navigating unfamiliar codebases. I also use it to quickly search many repositories for specific symbols when I research the consumers of libraries and APIs.
The release notes use the word "headling" twice instead of presumably "headline". I had to look it up in case this was a new usage of this archaic word.