jremmen / vim-ripgrep

Use RipGrep in Vim and display results in a quickfix list
MIT License
541 stars 99 forks source link

Don't seem to be able to search like I used to. #29

Open Frydac opened 5 years ago

Frydac commented 5 years ago

Hi,

EDIT: apparently I interpreted some things wrongly in my last explanation, maybe I hadn't updated git or something,.. don't remember how I came to the conclusion, everything seems to work.. though maybe a bit different than I was used to.

Following search pattern used to work, but doesn't anymore as such: :Rg -g *.chai pattern but when I quote the glob pattern, it does seem to work: :Rg -g "*.chai" pattern

Though slightly annoying, I can live with that, for me this issue can be closed now.

dlants commented 5 years ago

+1 ... using --glob is a very common thing for me as well, and I can't seem to get it to work now.

If it's still possible, it would be nice to put up an example of how to use that option in the README

Frydac commented 5 years ago

I updated my original post to remove some wrong explanation, in order to not confuse potential readers.

BrendanTimmons commented 4 years ago

I am also having this issue.

rg <pattern> -t js rg <pattern> -g '*.js'

both return results in shell but inside of vim they do not when using :Rg ...

Even when attempting OP's solution it does not work for me: :Rg -g "*.scss" background :Rg background -g "*.scss" both return no results but a simple rg background -g '*.scss' does or even rg background -tcss works too in shell.

Frydac commented 4 years ago

I forgot about this, apparently it works again on my system without the quotes. I don't understand why though, there haven't been any new commits since my original post.

I'm using

VIM - Vi IMproved 8.1 (2018 May 18, compiled Sep 29 2019 22:27:49)
Included patches: 1-2102
Compiled by Arch Linux
ripgrep 11.0.2

Looking at the source, you could try and add

  echom &grepprg
  echom &grepformat
  echom 'grep! ' . l:rgopts . a:txt

in vim-ripgrep.vim around line 64 before

silent! exe 'grep! ' . l:rgopts . a:txt

To try and see what is executed (then use :messages after executing your :Rg command to see the printed echom's), and maybe manually set grepprg and execute similar :grep commands, and be sure check :RgRoot command to show in which directory this is executed, maybe that is the problem?