Bash commands inside vi

bashshellvivim

Is it possible to type a bash command inside vi and get the stdout?

I find it often tedious to close and reopen vi just because I want to look something up in the shell.

Best Answer

Yes, e.g if you want to do ls, try:

:!ls

To spawn a shell, use

:shell