I am (slowly) switching to Vim for everyday Ruby on Rails coding (Linux Cinnamon 64bit). Being a newbie, I recently came across something I don't understand.
I want to use the :vimgrep and :grep commands for searching a pattern in a file tree from Vim. I am able to do so without problems with the :vimgrep command:
:vimgrep /User/gj **/*.rb
However, when I try to use the same command with :grep (which should use the system grep), no result is returned:
:grep User **/*.rb
Googling around, I found that the globstar options of my bash shell was not enabled:
$shopt globstar globstar off
It was easy to turn on:
$shopt -s globstar
I added the above line to my .vimrc file, and I made sure the option was permanently enabled in my bash.
With the new option, I could execute grep this way and get the desired results:
$grep User **/*.rb
Unfortunately, the :grep command from inside Vim is still not working with the '**'. And executing:
from inside Vim, the result is still off.
So the question is: can I propagate my bash's globstar option to my Vim external command environment? Otherwise, can I somehow set my grepprg option in Vim in a way that will allow me to use the globstar properly?
Thanks in advance to anyone who will help