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.
Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
151–160 of 198 posts
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#152Earlier quoted context omitted.
Yeah, the -M command is wonderful (super handy for ignoring minified files that you don't want to see results from, etc), and also great is the -g command (eg `-g *.cs` and you'll just search in files that have the .cs extension). Also the fact that it is a standalone portable executable can be super handy. Often when working on a new machine, I'll drop in the executable and an alias for grep that points to rg, so if…
If you're a fan of the -g flag to ripgrep then I also recommend checking out the -t flag, short for --type, which lets you search specific file types. You can see the full list with `rg --type-list`. For example, you could just search .cs files with `rg -tcs`. This flag is especially convenient if you want to search e.g. .yml and .yaml in one go, or .c and .h in one go, etc.
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#153Earlier 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.
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…
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.
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#154Earlier 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 "…
1. Thanks for this, instantly added to my dotfiles 2. You nerd-sniped me into getting rid of the unnecessary `cut` process :) file=${result%%:*} line=${result#*:} line=${line%%:*}
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#155Earlier quoted context omitted.
What? Git grep is all you ever need in my experience, and it's ~faster than~ (edit: as fast as) ripgrep when searching a git repo.
I really doubt git grep can outperform ripgrep in any tests... please provide some proof.
In some trees, git grep will be a lot faster because it searches a smaller part of it.
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#156Grep is already pretty much instant so what does it matter?
Very often, I don't want to look for files that aren't tracked under Git VC, and I'm not looking for matches in binary files, so by default, ripgrep does that, which can cut time by 99%. I used to grep in small dirs, now I can I can ripgrep in my whole home, not that I do it, but I can. That + Sourcegraph on master branch, and it makes searching for any other thing than plain text feel sooo slow (Atlassian Confluence and Jira, Google docs, etc.).
Thank you so much Burntsushi and contributors!
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#157Earlier quoted context omitted.
With fzf you can add lots of files to git while skipping some if you want: fza = "!git ls-files -m -o --exclude-standard | fzf -m --print0 | xargs -0 git add" With that in the [alias] section of a gitconfig file, running git fza brings up a list of modified and not yet added files, space toggles each entry and moves to the next entry. That alias as well as fzf+fd really speed up some parts of my workflow. Oh and sham…
Add the preview to see what you're actually stashing: git ls-files -m -o --exclude-standard | fzf -m --print0 --preview "git diff {1}" | .... And that's just the start: it could even be that by binding a key to the fzf reload command to then display the diff in it's finder, and in turn a key to stage the selected line, you could turn that into an interactive git staging tool.
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#158Earlier quoted context omitted.
I really doubt git grep can outperform ripgrep in any tests... please provide some proof.
git grep is shallow: only current git repo, rg is fully recursive, all submodules and also untracked (and not ignored) directories. In some trees, git grep will be a lot faster because it searches a smaller part of it.
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#159What are the reasons for grep not being replaced/improved? This topic seems a bit old by now.
Re: Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift (2016)
#160Earlier 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.
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…