Since Vim 8.1 there is a terminal built in. To run a quick command and keep the file in view, I’d open one in a split.
:terminal
:vertical terminal
:terminal, or just :term, opens your shell in a new window above the current one. :vertical terminal puts it beside it instead. You type in it like in any terminal, and exit closes it.
A few keys start with Ctrl-w in that window. Ctrl-w w jumps back to your file, and Ctrl-w N switches to Terminal-Normal mode, where you can scroll and yank the output with normal Vim keys. Press i to go back to typing.
You can also give it a command to run:
:term ++close make test
That runs the tests in a split, and ++close closes the window again when the command finishes. Without it the window stays, so you can read the output.
It needs a Vim built with +terminal. vim --version | grep terminal tells you; some minimal packages like vim-tiny don’t have it. Neovim has a :terminal too, but its keys and options are different.
A shell running in Vim stops when Vim exits, so long jobs are better off in tmux or a separate terminal.
Further reading: Vim help: :terminal
Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more