I currently have this autocommand in my vimrc:
autocmd BufWritePost *.tex silent! execute "!pdflatex %" | redraw!
It compiles my current LaTeX file whenever I save with
:w. However, a terminal window pops up every time I do so.
silent! seems to ensure the window automatically closes after a few seconds, but it does not prevent it from opening in the first place.