How to temporarily exit Vim and go back

Assuming terminal Vim on a flavor of *nix:

To suspend your running Vim

Ctrl + Z

will suspend the process and get back to your shell

fg

will resume (bring to foreground) your suspended Vim.

To start a new shell

Start a subshell using:

:sh

(as configured by)

:set shell?

or

:!bash

followed by:

Ctrl+D (or exit, but why type so much?)

to kill the shell and return to Vim.


You can use :sh to exit to your default shell then typing $ exit at the shell prompt will return you to Vim.


You can switch to shell mode temporarily by:

:! <command>

such as

:! ls

Tags:

Vim