Live data from Hacker News

Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)

blog.burntsushi.net

161–170 of 198 posts

Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)

#161
post #111

Earlier quoted context omitted.

I've never really seen PowerShell beyond minimal commands, but after seeing the parent, I definitely think it has the superior syntax of the shells. Especially for scripts.

Maybe if the "popular" shells, but http://www.nushell.sh/ is looking better and better

I use it near exclusively. Love nu.

Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)

#162
post #62

Earlier quoted context omitted.

I wrote a bash version of this: function frg { result=`rg --ignore-case --color=always --line-number --no-heading "$@" | fzf --ansi \ --color 'hl:-1:underline,hl+:-1:underline:reverse' \ --delimiter ':' \ --preview "bat --color=always {1} --theme='Solarized (light)' --highlight-line {2}" \ --preview-window 'up,60%,border-bottom,+{2}+3/3,~3'` file="${result%%:*}" linenumber=`echo "${result}" | cut -d: -f2` if [ ! -z "…

I've never really seen PowerShell beyond minimal commands, but after seeing the parent, I definitely think it has the superior syntax of the shells. Especially for scripts.

PowerShell is the worst of all worlds. Its a terrible shell compared to bash/zsh/whateversh, and for anything complex enough to need a long script you’re far better off in Python.

Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)

#164
post #62

Earlier quoted context omitted.

I wrote a bash version of this: function frg { result=`rg --ignore-case --color=always --line-number --no-heading "$@" | fzf --ansi \ --color 'hl:-1:underline,hl+:-1:underline:reverse' \ --delimiter ':' \ --preview "bat --color=always {1} --theme='Solarized (light)' --highlight-line {2}" \ --preview-window 'up,60%,border-bottom,+{2}+3/3,~3'` file="${result%%:*}" linenumber=`echo "${result}" | cut -d: -f2` if [ ! -z "…

I wrote a zsh version of this: function frg { result=$(rg --ignore-case --color=always --line-number --no-heading "$@" | fzf --ansi \ --color 'hl:-1:underline,hl+:-1:underline:reverse' \ --delimiter ':' \ --preview "bat --color=always {1} --theme='Solarized (light)' --highlight-line {2}" \ --preview-window 'up,60%,border-bottom,+{2}+3/3,~3') file=${result%%:*} linenumber=$(echo "${result}" | cut -d: -f2) if [[ -n "$f…

I love this, thank you! If anyone else wants to open the file in VScode, the command is

    code -g "$file:$linenumber"

Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)

#166

Would be nice if ripgrep was drop in compatible with grep. I'd feel like a dick writing a shell script for other people to use and forcing them to install a new grep

Never will be: https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#pos...

If you need drop-in compatibility with grep, then use grep. :-)

Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)

#167
post #153

Earlier quoted context omitted.

I expected to like Powershell when I began working somewhere with a lot of Windows (after decades of mostly Linux). I figured on paper this sounds like it has learned many important lessons that Unix shells could learn but (at least the popular ones) didn't, it's been given a blank canvas, the principles it's working to make sense, it has good people behind it. So I even undertook to write a modest new piece of glue…

> It also just doesn't feel like a quality product. On my work Windows laptop, Powershell will sometimes not quite bother flushing after it starts, so I get the banner text and then.. That’s independent of the shell, and is I believe a bug in the terminal emulator. There is an open source Windows Terminal you can separately install and that is so much better.

Nope, windows terminal definitely does this too. Just last week I was trying to install WSL, and thought it had frozen at 20% and was trying to figure out what went wrong ... turns out it had already booted but powershell had stopped flushing output.

Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)

#168

Earlier quoted context omitted.

This comment got me to get out my French press and manually grind some beans. It wasn't a meditative and calming as I remember, and the coffee tastes a little...dusty. I guess it's time for me to update my vimrc.

Aeropress is a direct upgrade from french press and uses way less coffee

I use my Aeropress every day but I wouldn't say it's "better" than French press, it's just different. Using less coffee but finer ground changes the characteristics of the brew quite a bit (probably some technical reason about extraction level or something).

Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)

#169
post #38

What are the reasons for grep not being replaced/improved? This topic seems a bit old by now.

Honestly: I rely on my shell scripts working and any "grep replacement" has to work with all the old crusty shell scripts out there, likely including ones that use odd "quirks" and GNU options.

If you want to innovate in this space, why sign up for all that? Invent a better wheel, and if people like it, they'll migrate over time.

I remember using ag in the old days, and I use rg now. But there's things rg does by default that I don't like at times... so I go back to old fashioned grep.

rg is at the point where many programmers use it. I think it is on its way to becoming one of those "standard tools". It needs... another 5 years?

When POSIX has a rg standard... we'll know ripgrep "succeeded" and teargrep will soon come into existence ;)

Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)

#170
post #3

It's fast indeed. And I can't help keeping promoting the combination with fzf :) For those who want to try it out, this is a Powershell function but the same principle applies in any shell. Does ripgrep then puts fuzzy searching in the resulting files+text on top while showing context in bat: function frg { $result = rg --ignore-case --color=always --line-number --no-heading @Args | fzf --ansi ` --color 'hl:-1:underl…

I use it neovim with fzf search.
Post reply on HN