How to open a shell inside a Vim window?

I can open the shell using the: shell command in Vim, however I cannot edit the file and use the shell at the same time.

Is there a way to split Vim in many Windows (or tabs) and open a shell in one of them?

+94
vim shell window
May 6 '10 at 16:36
source share
10 answers

Well, it depends on your OS - in fact, I have not tested it on MS Windows, but Conque is one of the best plug-ins.

Actually, it may be better, but it works.

+45
May 6 '10 at 19:41
source share

Vim 8 (and neovim) support this natively with the command :ter[minal] . See terminal-window in the documentation for details.

+37
07 Feb '16 at 19:52
source share

:vsp or :sp - splits vim into two instances, but you cannot use: shell in only one of them.

Why not display another terminal tab and not another vim tab. If you like this idea, you can try: Ctrl-shift-t. and move between them using Ctrl - pageup and Ctrl - pagedown

If you want only a few shell commands, you can do any shell command in vim with !

For example :!./a.out .

+18
May 6 '10 at 16:48
source share

If you haven’t discovered yet, you can use the amazing on-screen plugin .

Conque is also exceptional, but I find the screen much more practical (it doesn’t “clog” your buffer, for example, and you can just send the commands that you really need after editing them in your buffer)

+8
Mar 31 '11 at 3:05
source share

You can use tmux or screen (the second can only perform horizontal splits without a patch) to separate your terminal. But I do not know how to have one instance of Vim in both panels.

+7
May 6 '10 at 17:43
source share

I think this is a pretty old question, but now in 2017. We have neovim, which is a vim branch that adds terminal support.

So calling :term will open a terminal window. The beauty of this solution compared to using tmux (terminal multiplexer) is that you will have the same window bindings as in your vim setup. neovim is vim compatible, so you can copy and paste your .vimrc and it will work.

The big advantage is that you can switch to normal mode on an open terminal, and you can perform basic copy and edit operations. I think this is also very useful for git commits, since everything in your buffer you can use in autocomplete.

I will update this answer since vim is also planning to release terminal support, probably in vim 8.1. You can follow the progress here: https://groups.google.com/forum/#!topic/vim_dev/Q9gUWGCeTXM

Once it comes out, I believe this is a better installation than using tmux.

+5
Sep 13 '17 at 12:22
source share

Shougo VimShell , which can automatically fill in file names if used with neocomplcache

+3
Aug 02 '13 at 15:10
source share

Not quite what you are asking for, but you might be interested in my vim-notebook plugin, which allows the user to keep the background process alive and evaluate its part of the current document (and record the result in the document). It is intended for use in notebook-style documents containing fragments of code for evaluation.

+1
Oct 29 '14 at 18:33
source share

You can open the "screen" program, split the screen, open the shell on one and vim on the other. It works for me.

0
Jan 16 '16 at 21:20
source share

I am currently using tmux.

Installation: sudo apt-get install tmux Run it: tmux

Ctrl + b followed by Ctr +%: it splits your terminal window into two vertical halves.

Ctrl + "left arrow | right arrow": moves between terminals.

0
Jun 05 '16 at 11:28
source share



All Articles