:vimgrep can take multiple file globs. In simple cases that means you can potentially search only places you want instead of excluding (think white-listing vs black-listing)
:vimgrep /foo/ bar/** baz/**
:vimgrep isn't up to the task from performance and/or complex searching perspective. Instead you can use Vim's
:grep command to use an external command like
git-grep by setting
An example of using ripgrep to exclude
zxy and only search in
c files for pattern,
$ rg -g '!zyx' -t c 'pat'
With a few
vimrc settings you use
:set grepprg=rg\ --vimgrep
Inside Vim you can now use ripgrep and
:grep -g '!zyx' -t c 'pat'
Of course as D. Ben Knoble said above, you can always use
:Cfilter to filter/exclude from the quickfix after the fact