syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.7k stars 4.9k forks source link

Support ripgrep arguments (such as --type) in search #11316

Closed jonathanj closed 6 years ago

jonathanj commented 6 years ago

The Silver Surfer (ag) integration in Spacemacs supports passing extra arguments to ag (like --py) when performing the search (foo --py works, for example). Even though Ripgrep has this same functionality (via --type) I can't figure out if it's possible to pass these when doing a search from Spacemacs:

--type py foo results in

error: The following required arguments were not provided:
    <PATTERN>
USAGE: …

--not-an-argument foo results in

error: Found argument '--not-an-argument' which wasn't expected, or isn't valid in this context
USAGE: …

So something is happening, just not the right kind of something.

Kernael commented 6 years ago

I believe with something like foo -tpy it will work as intended, have you tried it ?

jonathanj commented 6 years ago

That does work! I guess it's the space that messes things up? I'm happy with this solution.