VIM-Shell: Why Hasn't Vim Had This All Along?

September 16, 2006

I stumbled across VIM-Shell completely on accident. it's a patch against Vim that does exactly what it sounds like; adds rudimentary shell support to Vim. Check it out:

Vim with a bunch of shell apps.
VIM-Shell with a bunch of apps (1680x1050 PNG).

The default patch kind of blows, so I cleaned it up and fixed a couple bugs (namely, the red terminal o' death bug reported on the mailing list). I've submitted the my fixes upstream, but they haven't been incorperated into the official version yet. In the mean time, you can get my improved patch by following the link below.

Download vim-7.0.72-vimshell-pabs-1.diff.gz (Signature)

Note: If you compile it under Linux, you'll need to add a link to libutil, either via configure or make, like so:

$ ./configure LDFLAGS=-lutil

or

$ make LDFLAGS=-lutil

If you don't, you'll get an undefined reference to forkpty(). I believe this is a problem with the original patch as well. Now that you're all excited, here's what VIM-Shell still needs:

  • Slightly better color emulation. Occasionally things seem to "bleed".
  • Session support. I use sessions pretty regularly, and it'd be nice to at least restore a blank shell. Even better would be pwd and history.
  • A way to send a literal Ctrl-W to the shell. Lots of apps use ^W, including Vim and Bash, so not having it is kind of annoying. Maybe a Screen-style escape like ^Ww?

Even with all these relatively minor gotchas, VIM-Shell is still damn cool.