The Journalist's Cage

And this gray spirit yearning in desire to follow knowledge like a sinking star...

HomeBlogTagsArticles

Calendar

January 2007
SuMoTuWeThFrSa
 123456
78910111213
14151617181920
21222324252627
28293031

Recent Bookmarks

Tags

Archives


RSS

Vim Shell Patch

I've been following the Vim development mailing list since early January in order to help me keep up with progress on Vim 7. On Friday, somebody mentioned the Vimshell patch in a message about integrated debugging support.

I'd never heard of Vimshell before, but I decided to investigate. One of Vim's major failings is that it can't run an ansi capable shell inside of a buffer. There are some relatively kludgy interactive shell buffer implementations that utilize scripting languages, but none of them are really very useful. I used to have one that uses Python. It doesnt do Ansi, it doesnt do vt100, it doesnt support tab completion, and it has a lot of other issues. Vimshell is different. Implemented in C, it provides complete support for almost all standard shell features. With Vimshell, it's possible to run an entire Vim session inside of a single Vim buffer. It's really a very impressive patch. Unfortunately, it too has some limitations. At the present time, it does not work with Gvim, and it doesnt allow you to use Vim normal mode key shortcuts inside of shell buffers.

My experiments with Vimshell were all quite succesful. I hade some compilation issues at first, because AAP doesn't like patches that add new files. When I dumped the AAP build and grabbed a normal tarball, I was able to patch and build without any errors. All of my tests were successful and impressive: I was able to run ssh, ftp, Vim, top, bash, and even emacs flawlessly in individual vim buffers.


Posted on 2005-02-271 comments



Ruby Window Management Library

In my article on innovations in window management, I mention the wmctrl utility, which allows users to manage X11 windows from the command line. It is compatible with most netwm/gnome compliant window managers, and it supports the vast majority of the EWMH specification. I'm fascinated by the capabilities of this helpful little utility, but I'm frustrated with some of its limitations.

Using the source code for wmctrl as a guide, I have constructed a window management library for Ruby in C. This library provides users with an intuitive and concise syntax for window management and control. Here are some simple examples:

Window.each do |w|
  w.close if
    w.winclass == "gaim" and
    w.title != "Buddy List"
end

Window.filter {|w| w != /Mozilla/}

Window.current.desktop = (Window//terminal/)[0].desktop

Window.each do |w|
  puts "#{w.title} - #{w.winclass} - #{w.desktop}"
end

Eventually, I hope it will be comprehensive enough to provide any window manager with all the Sawfish features i've become accustomed to using. At that point I plan to construct a daemon that will allow me to associate keyboard shortcuts with individual Ruby functions. I'll be able to utilize my keyboard-fu with a more featureful window manager. Right now i'm thinking about switching to Flux, or something else with window tab support.


Posted on 2005-02-261 comments