In a vanilla vim on Mac, when I type :set grepprg?
, it returns the following:
grepprg=grep -n $* /dev/null
.
I understand what -n
and /dev/null
means,
thanks to an old question here.
I also understand what $
and *
means individually.
However, I am not sure what to make of $*
.
I tried to look it up in the vim doc,
but all that I could find was
The placeholder "$*" is allowed to specify where the arguments will be included.
I sense that I am missing some important connection here.
I would really appreciate if someone could explain to me
how $*
works as a placeholder.
Update:
Thanks to the detailed explanation from @romainl,
I realized that I was misinterpreting $*
as regex,
whereas they are part of the convention in shell script.
In fact, there already exists old post
about this particular convention.
Silly me!