--- date: "2006-09-16T03:38:15Z" title: 'VIM-Shell: Why Hasn''t Vim Had This All Along?' --- <p>I stumbled across <a href="http://www.wana.at/vimshell/" title="Best Vim extension ever.">VIM-Shell</a> completely on accident. it's a patch against <a href="http://www.vim.org/">Vim</a> that does exactly what it sounds like; adds rudimentary shell support to Vim. Check it out:</p> <table border='0'> <tr><td> <a href='http://pablotron.org/gallery/misc/vimshell.png'><img src='http://pablotron.org/gallery/misc/vimshell-thumb.png' width='320' height='200' border='0' style='border: 1px solid black;' title='Vim with a bunch of shell apps.' alt='Vim with a bunch of shell apps.' /></a> </td></tr><tr><td style='text-align: center; font-size: 80%; font-weight: bold;'> VIM-Shell with a bunch of apps (1680x1050 <acronym title='Portable Network Graphics Image File'>PNG</acronym>). </td></tr></table> <p>The default patch kind of blows, so I cleaned it up and fixed a couple bugs (namely, the <a href="http://www.wogri.at/pipermail/vimshell/2005-January/000089.html" title="Description of the VIM-Shell red terminal bug.">red terminal o' death</a> bug reported on the <a href="http://www.wogri.at/pipermail/vimshell/" title="The VIM-Shell mailing list.">mailing list</a>). 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.</p> <p><a href="http://pablotron.org/files/vim-7.0.72-vimshell-pabs-1.diff.gz" title="My improved VIM-Shell patch against Vim 7.">Download vim-7.0.72-vimshell-pabs-1.diff.gz</a> (<a href="http://pablotron.org/files/vim-7.0.72-vimshell-pabs-1.diff.gz.asc" title="OpenPGP signature for my improved VIM-Shell patch against Vim 7.">Signature</a>)</p> <p><em>Note:</em> If you compile it under Linux, you'll need to add a link to <code>libutil</code>, either via <code>configure</code> or <code>make</code>, like so:</p> <blockquote> <p><code>$ ./configure LDFLAGS=-lutil</code></p> </blockquote> <p>or</p> <blockquote> <p><code>$ make LDFLAGS=-lutil</code></p> </blockquote> <p>If you don't, you'll get an undefined reference to <code>forkpty()</code>. 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:</p> <ul> <li>Slightly better color emulation. Occasionally things seem to "bleed".</li> <li>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.</li> <li>A way to send a literal <code>Ctrl-W</code> to the shell. Lots of apps use <code>^W</code>, including Vim and Bash, so not having it is kind of annoying. Maybe a <a href="http://www.gnu.org/software/screen/">Screen</a>-style escape like <code>^Ww</code>?</li> </ul> <p>Even with all these relatively minor gotchas, VIM-Shell is still damn cool.</p>