Live data from Hacker News

Ripgrep 14 Released

github.com

31–40 of 73 posts

Re: Ripgrep 14 Released

#31
post #22

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

En garde! If you're a Vim user, fzf.vim [1] can do this. :) [1]: https://github.com/junegunn/fzf.vim

If you don't need live updating output, you can just set grepprg and get results in the quickfix list with :grep[!] (or the location list with :lgrep[!]).

  if executable('rg')
    let &grepprg = 'rg --vimgrep $*'
  endif
No need for Fzf/Telescope/Denite/DDU or anything else in that case.

See:

https://neovim.io/doc/user/quickfix.html#%3Agrep

https://neovim.io/doc/user/options.html#'grepprg'

Re: Ripgrep 14 Released

#32
post #22

Earlier quoted context omitted.

En garde! If you're a Vim user, fzf.vim [1] can do this. :) [1]: https://github.com/junegunn/fzf.vim

If you don't need live updating output, you can just set grepprg and get results in the quickfix list with :grep[!] (or the location list with :lgrep[!]). if executable('rg') let &grepprg = 'rg --vimgrep $*' endif No need for Fzf/Telescope/Denite/DDU or anything else in that case. See: https://neovim.io/doc/user/quickfix.html#%3Agrep https://neovim.io/doc/user/options.html#'grepprg'

used to do that with glimpse when i worked with very large codebases 23 years ago!

big fan of ag, ripgrep and burntsushi's rust work!

Re: Ripgrep 14 Released

#34

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

deadgrep is nice too

Re: Ripgrep 14 Released

#35
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.

Re: Ripgrep 14 Released

#37

Earlier quoted context omitted.

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

I wanted to like sd but it doesn't support my main use case of recursive search/replace. Imagine if every time you wanted to grep some files you had to build a find -print0 | 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

If you haven't discovered recursive path expansion with `**` yet, which is supported by a number of popular shells, including bash, it is about to improve your shell life.

Re: Ripgrep 14 Released

#38

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) https://github.com/BurntSushi/ripgrep/issues/152

Seems like the issue pretty much covers this.

Re: Ripgrep 14 Released

#40
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.

Recently a colleague had a bug. He told me it was related to the "X" that was weirdly behaving like a "Y".

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.

Post reply on HN