dajva / rg.el

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

Question about using glob pattern with rg #155

Closed senthil1216 closed 1 year ago

senthil1216 commented 1 year ago

I am a new beginner user to Emacs. Can someone point on how to use rg.el along with glob patterns to include or exclude dirs? This is the command i have been using

M-x rg RET
Regexp search for (default -*-): SEARCH_PATTERN -g *.txt

But i get the results as rg finished with no matches found at Fri Apr 21 10:23:12

dajva commented 1 year ago

Normally you us the ripgrep type flag, iow using predefined file types that could include one or more glob pattern. If you want to use custom glob patterns you just insert that in the file type prompt instead of the predefined rigpgrep type. See https://rgel.readthedocs.io/en/2.2.1/usage.html#file-type-aliases ripgrep has the --glob flag for more advanced including and excluding of files dir. It's available from the rg.el menu but you have to consult the ripgrep manual how to use it.