Search code examples
vim

How to temporarily exit Vim and go back


How could I exit Vim, not :q, and then go back to continue editing?


Solution

  • 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.