Sorry for the drive-by post, but I threw this together because you reminded me I've wanted the same thing.
Put the following in ~/.vim/ftplugin/qf.vim:
""" begin """
function! QfHlMatch()
if exists('w:quickfix_title') && w:quickfix_title =~ 'vimgrep'
if exists('b:QF_HL_id')
call matchdelete(b:QF_HL_id)
endif
let pat = substitute(w:quickfix_title, '\v.*vimgrep\s+(.)(%(%(\1)@!.|\\@<=\1)+)\1.*', '\2', '')
let b:QF_HL_id = matchadd('IncSearch', pat)
endif
endfun
augroup QF_HL
au! * <buffer>
au WinEnter <buffer> call QfHlMatch()
augroup END
call QfHlMatch()
""" end """
It uses the quickfix window title to extract the pattern used for the search. There may be a better way to get that.
If you need help understanding what's going on in that regex, consult the :help for:
/\%(
/\@<=
/\@!
etc.
The purpose of the regex is to strip out everything before the vimgrep pattern, delimited by an arbitrary character, keep up to the first non-escaped delimiter character, and strip out everything after. I've noticed it may do weird things if you use certain weird delimiters in certain cases but it mostly seems to work. There may be a better way.
I used IncSearch rather than Search because the current line in the quickfix list is already highlighted with Search. If you have different highlighting defined for each of those you'll be able to see the match even on the current line.
Matches update whenever you enter the quickfix list window. You could use CursorHold or similar if you want it to update automatically without going to the window.
Oops, b:QF_HL_id should be w:QF_HL_id throughout.