Assuming you are using
to "select a line in the quickFix list", you can simply remap
in the quickfix window so that you come back to the previous window after jumping to the matching line.
Make sure you have filetype plugin indent on
and add the line below to ~/.vim/ftplugin/qf.vim
:
nnoremap p