Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to access the terminal while using Vim?

I do not like to open another terminal or save and exit the current terminal.

share|improve this question
Open a new tab? (Ctrl + Shift + T) – Wilf Jul 12 '14 at 12:44
How many times do that :) I do not like to do that D: – lion Jul 12 '14 at 12:49
Have you tried using a terminal window manager like tmux? – James Jul 15 '14 at 20:46
up vote 52 down vote accepted

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.

share|improve this answer
Or just % instead of fg. Or %1, %2, etc. if you have many background jobs. jobs command will list them. (Assuming bash as the shell.) – Ruslan Jul 12 '14 at 16:26
I vote for the ^z (and later fg) method, because this can be used in almost all shell processes - it's not a vim thing, it's a how-to-use-shell trick that is incredibly useful in other contexts. – dman Jul 14 '14 at 10:12

In vim, just type:


:! 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:

share|improve this answer
Or just use :shell. – wchargin Jul 12 '14 at 15:54
This is the best answer for most purposes. – Frank Conry Jul 13 '14 at 4:08

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.

share|improve this answer

As addition to all answers.

You can install ConqueTerm plugin

This plugin provide ability to run interactive programs inside vim buffers.

After installation you can add this 2 lines to your .vimrc:

:nnoremap <S-w> :q!<CR>
:nnoremap <S-t> :ConqueTermSplit bash<CR>

And you will be able to run bash by pressing Shift + T, and close current Conque tab by pressing Shift + W

It is perferct if you need fast open/close bash.

Here is gif that showing how it is look like

share|improve this answer

Another option with either screen or byobu is to open a tab within those programs. These programs make it fairly easy to keep a terminal-session c.q. shell open and switch between those screens with the keyboard.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.