Vi's composability antecedent (or one of them)

June 2, 2014

These days the venerable vi editor is getting a bunch of praise for its genuine and core innovation of composable commands, such as in Mike Kozlowski's Why Atom Can't Replace Vim. I wholeheartedly support this; vi's command composability is amazing and powerful and I wish more programs used or even embraced the ideas behind it (as far as I know, vi's basically the only editor that's ever really done this).

But today I want to mention that vi's composability is not without antecedents, in fact antecedents in Unix itself. The antecedents are nowhere near as fully developed and nice as vi, but in them I think we can see the kernel of vi's idea (as well as some ideas that did not catch on in vi). In fact, one antecedent is even buried in vi itself. I am of course talking about the family of Unix line oriented editors that gave us ed, sed, and vi's ex mode.

Like vi itself, all of these editors revolve around a fundamental idea: you specify first text addressing and then the command to apply to whatever you've specified. Want to delete the next five lines? First you specify five lines as '.,.+5', and then you say to 'd' what you've just addressed. Learn a new addressing method and you can use all of the commands you know with it; learn a new command it works with all of the addressing methods you know. This is the same core engine as vi has, although in a much more primitive and limited form of both addressing methods and available commands.

(And if you want to see things that way you can think of Unix pipelines as a form of this idea. Clearly pipelines compose things together, although in a more general way than vi et al do.)

PS: to note this antecedent is in no way to take away vi's striking accomplishment in generalizing it and applying it to more sophisticated movement and addressing as well as more complex text manipulation, and also figuring out how it should all work in a visual, character based environment instead of the basic line oriented one that ed uses.

(See also the history of ed, which stretches back even before Unix.)

Written on 02 June 2014.
« Wnen trying to unsubscribe from spam can be not completely crazy
My just-used Go logging idiom and why it is in fact wrong »

Page tools: View Source, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Mon Jun 2 01:33:21 2014
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.