Access to the terminal while you are on Vim
You can send vim the SIGTSTP signal. You do this by pressing ctrl+z. Vim will get suspended in the background, and you can use the terminal. Type fg
in the terminal to resume with vim.
Bonus tip: This works on nearly all terminal applications. Use bg
to enable the application to continue running in the background.
In vim, just type:
:!sh
:!
launches an external process -- in this case sh
, another shell. Control will return to vim once you exit the shell. If you want to use the shell concurrently with vim, add &
to the end of the sh command:
:!sh&
You can use the :shell
command (or the short form :sh
). From :help :shell
:
This command starts a shell. When the shell exits (after the "exit" command) you return to Vim. The name for the shell command comes from 'shell' option.
By default, on Ubuntu, this will give you bash. type exit
to return to vim when you're done.