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
Add -g
option from ag
#75
Comments
It's already there. Use |
I had seen that option, but it's not equivalent: $ ag -g django
notebook/static/components/codemirror/mode/django/django.js
$ rg --files -u | wc -l
18281
$ rg --files -u | rg -N django
notebook/static/components/codemirror/mode/django/django.js
|
@rubik Check out |
Thanks, I actually read |
hey @rubik I also use Ctrlp, and I set up ripgrep as a replacment for silversearcher (ag), but one problem I'm having is that using ripgrep, the list of search results includes the full path to the file. I don't like showing the full path, it clutters things. Somehow using ag, the results only included the relative path of the project: app/models/user.rb (for example) and using rg, the result would show: /User/myusername/projects/someproject/app/models/user.rb I spent about an hour or two trying to find some option in either ctrlp or ripgrep related to this, and could not. I know this sort of might be the wrong place to solve this, but it might not be. Here is my relevant vimrc below. If you got ripgrep working with ctrlp in vim, could you tell me what I'm missing? Thanks.
|
@pdbradley Running with
Note the last example above. ripgrep outputs paths based on the paths you've specified. |
Note that
|
I figured it out. In my vimrc I needed to change this:
to this:
i.e, remove the "". I don't know why I had that in there. now the paths look fine in ctrlp. thanks for your attention @BurntSushi I heard about ripgrep on The Bike Shed podcast and thought I would try it out. great work. |
The
-g
option searches only in the file names. Example:$ ag -g init | head scipy/sparse/linalg/eigen/arpack/__init__.py scipy/sparse/linalg/isolve/__pycache__/__init__.cpython-35.pyc scipy/sparse/linalg/isolve/__init__.py scipy/sparse/linalg/__pycache__/__init__.cpython-35.pyc scipy/sparse/linalg/__init__.py scipy/sparse/linalg/dsolve/__pycache__/__init__.cpython-35.pyc scipy/sparse/linalg/dsolve/__init__.py scipy/sparse/__pycache__/__init__.cpython-35.pyc scipy/sparse/__init__.py scipy/sparse/csgraph/__pycache__/__init__.cpython-35.pyc
It's quite useful in combination with
ctrlp.vim
, to replace the Vim file finder with a faster alternative. Does it seem like a sensible addition to rg?The text was updated successfully, but these errors were encountered: