dajva / rg.el

Emacs search tool based on ripgrep
https://rgel.readthedocs.io
GNU General Public License v3.0
474 stars 39 forks source link

Rg always asks for which file type to search. #45

Closed pranavsharma closed 5 years ago

pranavsharma commented 5 years ago

Can this be defaulted to --type all ? It's a bit annoying to always type 'all' when presented with a prompt "Search for files"..

dajva commented 5 years ago

Yes you can define your own search function with the rg-define-search macro like so:

(rg-define-search rg-search-all
:files "all")

And bind it to your favorite key behind the rg-keymap-prefix.

(define-key rg-global-map "a" 'rg-search-all)

There are a lot of more options for the rg-define-search macro if you want to tune it more specifically.

dajva commented 5 years ago

I close this now. Please reopen if your issues are not resolved.

pranavsharma commented 5 years ago

I use rg-project. Does rg-define-search work for project searches as well?

pranavsharma commented 5 years ago

I tried this and it works. Thanks!

(rg-define-search rg-search-all :files "all" :dir project)