I'm trying to create a command that would accept arguments, and then call
vimgrep with those arguments and display the quickfix window. I set up my command like
command! -nargs=* Vsearch :call <SID>VimGrepSeach(<q-args>)
<SID>VimGrepSearch is defined by:
function <SID>VimGrepSearch(query) execute "normal! q:vimgrep /\\v" . a:query . '\g' escape('**/*', ' \') endfunction
This will search all of the current directory and display the results in a quickfix window, if the equivalent is ran directly from command mode.
However, when I run this as a command, I get the quickfix quickly popping up, but then it's immediately hidden. What's going on here? Why does the quickfix window appear and then hide, and how can I have it stay open?