tags:

views:

1350

answers:

6

I can setup my workspace nicely with split and vsplit and open... but I would like to simply use one of the splits as a terminal window. I know opening an additional xterm and placing it strategically might be able to accomplish this but many times I am telneted into a single window and my hands are beginning to hurt from alt tabbing between terminals.

Update: The best thing I came up with based on the suggestions below was to use screen and actually have vim occupy one of its windows.

+1  A: 

You will have to forgo this I'm afraid - no way to do it in vim.

anon
+2  A: 

If you're in vim, you can exit to a sub-shell with the ":sh" command, and then get back to vim with "exit". Or you can just suspend vim and go back to the original shell you started it from with control-Z, then go back to vim with "fg" (foreground).

Or there is an "vim-shell" add-on you can install.

Paul Tomblin
+8  A: 

Consider running Vim and a shell together in GNU Screen. The Vim wiki has info on integrating Vim and Screen. Screen supports splitting into "windows" similar to Vim's. See here for an example of even tighter Vim+Screen integration.

Having a Vim buffer tied directly to an external interactive commandline app is a feature that many have wanted for a long time, but apparently it's a bit difficult to do, due to how Vim is implemented, and the Vim devs are reluctant to change this (for arguably good reasons).

But there have been a few success stories. The Lisp community in particular has tried to reproduce Emacs' SLIME (an interactive Lisp prompt) in Vim. See VimClojure and Limp for examples. One of those could probably be altered to run a shell, but it'd take some work.

Brian Carper
+2  A: 

Expanding on Brian Carper's answer, you could throw this into your ~/.screenrc:

startup_message off
# Launch 2 screens on startup
split
# Have bash login so $PATH will be updated
screen -t Vim bash -l -c 'vim' 0
focus
screen -t canvas bash -l
# switch focus back to vim
focus up

Then when you type screen, you'll have a Vim window on top and a bash window on the bottom. You can switch between screen windows with <C-a><Tab>.

jmdeldin
+3  A: 

The vimshell patch sounds like what you're looking for.

Michael
Wow. Very nice.
ojblass
+1  A: 

I use : http://code.google.com/p/conque/wiki/Usage

You can type :split new and the :ConqueTerm bash. And you have a working terminal window. :)

Claudiu