One of the primary distinction betweeen vi (vim) and emacs, is emacs is designed and supposed to be run at times without quitting, where as given the quick load time of vim, it
Just use the :!
command to run stuff in a shell. It mixes great with :cd
and %
expansion
bash> vim path/to/ex.c
...
:cd %:h. " move to path/ex/
:!gcc -o %:r % && %:r " compile ex.c into ex and run it
You can also mix it with :read
if you want to put the output of a command in the current buffer:
:read !ls " read in the names of all the files in the current directory