Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ripgrep #3

Closed
gabebw opened this issue Jun 22, 2017 · 4 comments
Closed

Ripgrep #3

gabebw opened this issue Jun 22, 2017 · 4 comments

Comments

@gabebw
Copy link

gabebw commented Jun 22, 2017

Is ripgrep working well for you in general and as your :grepprg? Is it faster than ag?

@teoljungberg
Copy link
Owner

I moved over to ripgrep from git grep, and I didn't notice any major performance improvements. It feels faster(which accounts for something) but I have not done any benchmarks to prove so.

What irked me about ag is the lack of compatibility with grep(1), and it took some tweaking to rg for it to behave how I wanted it to. The :grepprg I ended up with, which now works how I want it to is:

set grepprg=rg\ --hidden\ --glob\ '!.git'\ --vimgrep\ --with-filename
set grepformat=%f:%l:%c:%m

I want my :grep to work with:

  • Grepping for hidden files(let's be real, it's mostly dotfiles)
  • Ignore .git, because there's rarely a use-case where I want to search inside of it. And when I do, I can always specify the full path and find what I please.
  • I want to always display the filename I'm grepping for, meaning I can use :grep some-token aswell as :grep some-token path/to/some/file interchangeably.

Hope that helps!

@teoljungberg
Copy link
Owner

Also I love the idea of adding issues to ones dotfiles repository to keep track of things you want to look into / polish!

@gabebw
Copy link
Author

gabebw commented Jun 28, 2017

I was super disappointed with ripgrep's speed vs ag, then I realized I had told ag to ignore lots of things (like images!) so ripgrep was searching like 15% more files than ag.

I fixed it in this commit, which tells ripgrep to use this file to find more things to ignore on top of the gitignore.

@teoljungberg
Copy link
Owner

Since rg ignores what's present in the .gitignore - I haven't needed to have another ignore file (yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants