Live data from Hacker News

Ripgrep 14 Released

github.com

11–20 of 73 posts

Re: Ripgrep 14 Released

#11
post #8

rg is great, I use it a lot. 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.

You could use "find" (or even better, "fd") to find specific filetypes, then pass it to amber via xargs or some similar way.

Re: Ripgrep 14 Released

#12

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?

It creates links in the output. You click them. It opens the file. That's pretty much it.

Re: Ripgrep 14 Released

#13

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?

Terminals (some terminals) support hyperlinks and it creates clickable links. For example ls -l --hyperlink=auto If you terminal supports it, you can click the names.

See here for more info: https://github.com/Alhadis/OSC8-Adoption/

Re: Ripgrep 14 Released

#15

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?

So, when you search for "foo" in mydir/, rg can find the term foo inside different places in a number of files, and then print the results like:

  mydir/myfile.java
  15: return foo;
  78: System.out.println(foo);
  123: // TODO: change foo to bar
Hyperlink support means that the line numbers (15, 78, 123) are clickable, and will open your favorite editor to that file and that line number.

That's if your terminal supports hyperlinks, or has hyperlink support enabled - most do. Depending on the terminal app it might be control/cmd click, or option-click to open the hyperlink.

Note (this got me while trying): hyperlinks are not emitted when you search inside a specific file directly, e.g. "rg foo myfile.py".

Re: Ripgrep 14 Released

#16

If you are an Emacs user like me, you must 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! [1]: https://github.com/minad/consult

am a big fan of the whole consult/vertico/embark stack of emacs plugins. They're fantastic.

Re: Ripgrep 14 Released

#17
post #8

rg is great, I use it a lot. 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 throw in sd as a nice sed/find-and-replace tool. Using fd + xargs + sd is a pretty good workflow if a shell glob isn't good enough to target the files you want. https://github.com/chmln/sd

Re: Ripgrep 14 Released

#18

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?

Sibling comments have explained, but the keyword to search to learn more is "OSC-8 hyperlinks"

Re: Ripgrep 14 Released

#20
post #15

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?

So, when you search for "foo" in mydir/, rg can find the term foo inside different places in a number of files, and then print the results like: mydir/myfile.java 15: return foo; 78: System.out.println(foo); 123: // TODO: change foo to bar Hyperlink support means that the line numbers (15, 78, 123) are clickable, and will open your favorite editor to that file and that line number. That's if your terminal supports hy…

I'm fascinated! I've been living with and authoring CLI tools for about a decade now and I didn't know that there's widespread support for additional attributes on text besides styling (color, italics, underline, etc) in common terminal emulators. What a cool thing!
Post reply on HN