红联Linux门户
Linux帮助
当前位置: 红联Linux门户 > Debian

EMACS 对 vi:永无止境的圣战

发布时间:2009-07-26 21:19:50来源:红联作者:刘冲
[i=s] 本帖最后由 刘冲 于 2010-4-12 23:50 编辑 [/i]

下面是转的,不是我翻译的.刚才这个帖子被顶起来了我看了下,突然发现,看上去好像是我翻译的似的,怕怕,故声明一下.
由此产生的歧义造成的读者的困惑我深表歉意!

原文标题 EMACS vs. vi :The endless geek 'holy war'

翻译的不好,有些句子不知道如何译的我就直接留的英文原文,大家见谅

EMACS vs. vi The endless geek 'holy war'
EMACS 对 vi:永无止境的圣战

刚走没多久,又开始了。我们linux版的版主表示这周的使用指南将要取消,这个指南是关于使用vi能够完成的一些新的任务。

Greg Menke发出了第一个置顶帖。使用vi?那该多么麻烦呀?他把自己的步骤贴了出来:

1.获得一条任意品种的鱼,长度大于12英寸就行

2.冰冻一晚上

3.把它放到电脑前,运行vi

4.抓住鱼的尾巴不停的往你头上砸,直到你决定用EMACS。因为鱼鳞在你周围飞溅并且你的头开始痛

Menke,当然,他是在暗示,顽固的不仅是vi,vi的用户更甚,他们顽固到拒绝承认他们虐待自己,就像拿冰冻的鱼砸自己的头一样。

没过多久,vi的拥护者们开始回击,其中一个建议Menke把这一行加到他的步骤中去:在第1步之前键入emacs,这样在第4步结束时emacs才可能加载完成。
他是在说EMACS编辑器慢吗?

就好像疲乏的军队在短期休战中拒绝放弃战争一样,vi和EMACS用户在Linux,SAGE和其他计算机连接着的虚拟社团中冷战不断。幸运的时候,冷战会暂时消失几个月。但是一旦一方流露出些微的轻视,战火会重新燃遍整个新闻组和邮件列表。出于他们的社区文化,任何一个阵营中如果有人认为他们用的是世界上最好的编辑器而使用其它编辑器(尤其是对立阵营)的人都是傻瓜,那么给予他足够的嘲讽,他会意识到自己是错的。

现在,关于Unix上哪款编辑器才是上帝的杰作的分歧并没有严重到给世界带来麻烦,像可口对百事是一场没有结果的战争,仅仅是小范围内的激进分子们在高呼“加油!”。

“就我所知,EMACS和vi的人口比例大致是50/50,”作为一个长期在开源和黑客社区中扮演各种角色的人类学家,EricRaymond在邮件中这样说道,“Pico,joe,MicroEmacs以及其他编辑器,在整个时期的统计上来看,已经消亡了。” Raymondcan personally date the vi/EMACS split back to 1985 and stipulatesthat, in all likelihood, it went on long before that.

早在1991年,Raymond就在Jargon File(http://www.tuxedo.org/jargon/)中记录了vi和EMACS之间的圣战,perhaps the ultimate collection of hacker terminology.

当被问起时,许多对两者都熟悉的人会说它们的区别在速度和功能性,vi的用户指出他们能快速的在文档中移动和修改,而EMACS的拥护者则吹嘘他们无穷的定制性。Vi用户嘲弄EMACS有太多不必要的装饰;EMACS用户则嘲弄vi难于入门而且功能有限。

所以,最好的编辑器之争在技术上等价于"tastes great/less filling?",是的,有几分。不过,所有的宗教或者战争给我们的教训是:你挖的越深,流出来的越黑。

当然,争论也不是完全没有意义的,我们的电脑世界就是由这些编辑器从最初的一无所有而建立起来的。这些对最终用户透明的编辑器,有着如此忠诚的拥护者,无非也是体现了人们想用最理想的方式来做事的朴素愿望。

Vi: 被时光遗忘的编辑器?

第一眼看上去,从外表上,vi就是那种被遗忘的。它不是那种你一打开终端就要用的东西(对这种想法,你最好去用EMACS)。即使是VIM,这个vi用户最近使用的新版本,也会让人惊讶(或者说被挫败)于不知道如何下手。

即使是VI Lovers的站长也承认,学习曲线太陡峭了。“Vi 在你知道25个以上命令之前不会让你变快,”阿姆斯特丹本地人Thomer Gil这样写道,他现在任职于麻省理工学院计算机系。

Gil因为使用VIM,被他的同事们比作“野人挥舞着斧和棍”。

在vi的所有的“缺点”中,最显著的一点是仅仅想往屏幕上随便输入一点什么该如何开始。Vi有两个模式:其一是插入模式,这时你可以键入文本,你可以敲insert键进入这个模式。还有一个是命令模式,这个模式下你不能键入文本,只能输入命令,你可以从插入模式敲esc键进入命令模式。

想象一下用户第一次使用vi,意外地敲了esc键,除了发现他不能再输入文本外,还发现程序随着他的击键做出各种古怪的举动。

Jargon File 中冷冷地指出vi的这个特性“无休止的困惑着新手,因为它要么在想输入文本时当成命令,要么相反,而且默认情况下不提示用户当前处在哪一个模式。”

“多模式让人们觉得怪诞。”Gil承认。

Vi由Bill Joy于1976年写成,融合了两种更原始的编辑工具:ed和ex。Vi代表着“visualinterface,”which in 1976 was in quite the bleeding edge in computing,according to a Joy interview in Linux Magazine。

“我尝试使它能通过300波特率的调制解调器使用,这也是为什么存在这么些古怪命令的原因了。它恰好能通过调制解调器使用,而且是全屏的,”Joy说“所以这款编辑器被优化成当屏幕显示极慢时也能用。”

在那次采访中,Joy对比了EMACS的开发环境,认为EMACS是专为光纤连接的系统和巨大的PDP-10而设计的。

“所以他们可以有许多有趣的命令,如屏幕上闪着微光等等,而此时,我坐在伯克利州二战遗留下来的屋子里,利用调制解调器和终端,这些仅仅只够光标从屏幕底部消失,”Joy说,也许听起来有一点嫉妒。“人们并不知道vi被设计用于一个再也不存在的世界。”

然而,在80年代早期网络与处理器飞速发展的时候,这个vi理应消失的时代,vi却空前繁荣起来。VI Pages列出了近30种vi的克隆体,从elvis和VIM到很少听过的如WinVi和vigor。

Tim O'Reilly,O'Reilly 出版公司的策划在公司的Ask Tim栏目表明公司卖出了两倍于EMACS的vi的图书。更甚,任何时候O'Reilly在一些大会上发起的vi 对 EMACS 的彩弹球游戏中,vi总是有两倍于EMACS的志愿者数目。

他们追求的是什么呢? John Arundel恰如其分的描述:“观看一个vi高手对文件做复杂编辑时,当他手指在键盘上飞舞,文字像刷屏一般,你会认为他具有超人的力量。”

Gil在他的网站上发布了这种技巧的一些例子。“vi的关键在于组合特定的动作(删除、复制到缓冲区、变成大写等等)和移动(到第25行,到文档末、到下一处foo,到这一行的第二个x,等等)。”

“Huh?”我发邮件给他。

Gil发回了一个例子:“如果,举例来说,一个文档包含了这样一行:'a b c d e f g' 光标在b处,这时我可以键入'd/f'。”

第一个d表示删除,/ 表示搜索,所以这个命令表示从b删除到f。

“使用这些没什么特殊要求...删除单词、句子,回到先前的地方,Oh,不,再跳回去,撤销我刚做的,重做一次,”Gil 这样写道。

Gil 保证你在EMACS中也能做同样的事,然后,它需要记忆笨拙“Ctrl-X Ctrl-c Alt-F4 的键组合”。

Gil展示的另一个窍门是VI用户如何在文件中移动。“笨拙的方式是使用箭头键;这有许多其他方式,更高级的方式来移动。”Gil写道。vi提供的高级方式包括跳转到上一次或上几次光标所在处,跳转到特定单词的下一处,跳转到下一个句子或章节。

即使双模式的特性对用户来说变得透明。大约一年前,我和Jon Lasser一起探讨他最近出版的一本书--Think Unix。(他告诉我这本书的手稿是完全用vi写成的)。最后我们谈起vi,我开始抱怨vi的两种模式。

Lasser解释说他没看出使用vi和使用字处理器如StarOffice或者Microsoft Word有什么不一样的地方。总的来说,当你把手移动到屏幕区以外,你就无法输入文本。你实际上就是从插入模式转到了命令模式。“它们完全是一样的东西。”他这么解释。

就像O'Reilly所写的那样:“像UNIX上的许多东西一样,它仅仅是看上去很难。”

EMACS极尽奢华?

当vi最忠诚的O'Reilly在Ask Tim中写道他最初从EMACS转到vi仅仅因为他的EMACS配置文件损坏了。这是vi用户针对EMACS的无数攻击之一。

EMACS和vi质朴而有限的命令形成鲜明的对比,因为它几乎有着无限的自定义性。人们让它是什么它就是什么,然而这种力量对用户而言不见得就是最好的。
像Emacs-Beginner-HOWTO上所说的,EMACS可以是一个文本编辑器,邮件客户端,新闻阅读器,字处理器,脚本编辑器以及编程语言的集成开发环境。

能做到这个的关键在与EMACS提供的多模式,每个模式有唯一的命令集。想要查看邮件?进入邮件模式就好了。想要写C++程序,用C++模式吧。要创作Web页?html-helper模式正好合适。

掌握所有这些之后,你也可以自定义EMACS甚至是添加新的功能,通常这都是通过修改Lisp代码来完成的。

vi用户认为EMACS的专横跋扈之处在于,它本该是一个单纯的文本编辑器,不应该为得到用户而什么都做。一个正在流行的笑话是EMACS是一个捆绑了文本编辑器的操作系统。

“EMACS实际上在刚开始是一个标准的工程,”Guy Steele在邮件中说。他是EMACS最初的作者之一,另一个作者是Richard Stallman,后来建立了自由软件基金会的那位。

据Steele回忆,Stallman当时维护着一个PDP-10上早期的编辑器----TECO,意思是“Text Editor andCOrrector”。尽管固定的击键会执行编辑命令,Stallman创造了一种用户可编程的表格“这样每一个击键所对应的动作都在表格中查询得知,”按照Steele的说法。“一个选择是执行用户指定的TECO宏。”

使用这种宏功能,用户把自己的一套宏通过编程绑定到各种击键序列上去,但是这样当程序员们在一些程序上合作时就存在问题了,因为他们发现他们之间很少有共同的击键序列。

“因为文本(程序)编辑的技巧,用户间的交流开始支离破碎,”Steele写道。所以Steele连同David Moon和Stallman一起,开始了一个整合所有的想法到一个统一的命令集的工程。

“我在纸上做了一个原型,仔细揣摩了那些各种各样宏包的作者和用户,”Steele在邮件中说。

“我记得很清楚,”Dan Weinerb回忆说。他是EMACS的alpha版测试者之一。“这家伙在他的剪贴板上展示全部的键绑定,这是他仔细的从每个人那里收集在一起的统一的、标准的键绑定。”

几个月之后,Steele忙着完成他的博士论文,工作交给了Stallman。And the rest is history。

从一开始加入的灵活性给予了EMACS优势,铁杆用户这样说。

“我觉得EMACS就像是编辑器中的瑞士军刀,”Debra Cameron在邮件中说,他是Learning GNUEmacs的合著者之一,CameronConsulting的老板。“它是一个完备的工作环境,一个微观世界。如果你想让它做些什么,很可能你会发现(在一番寻找后)它已经做到了。如果还没有,你可以自己扩展它来做到你想做的。”

我们就不能和平相处吗?

该怎么比较EMACS和vi呢?

“我见过许多熟练的vi用户展示了一些漂亮的技巧,但是我仍然认为vi只是一个编辑器,尽管出于某些原因它是一款出色的编辑器,”Cameron在邮件中说。“[它]总是,总是用相同的方式工作。从这方面说,它像麦当劳;不管你去哪一家,总是很精确的保持一致。”

“你想要一款编辑器它能被任意修改来满足你的需要和怪癖同时还能做很多很多事,或者你仅仅只是想很快的在任何机器上编辑文件?”她这样问。“对于那些总要从一台机器上移到另一台的人们,这种一致性确实是一个优势。”

换句话说,EMACS等于灵活性,而vi等于一致性。

这就是事情变得黑暗的地方。

“EMACS当然比vi要复杂的多,但是我不相信它在任何有用的地方能做的更强,但是vi是设计为UNIX系统的一部分并且能和其他系统相互协作,”Jon Lasser反驳。

请注意,对Lasser来说,“有用”的意思是指vi允许你从其他进程通过UNIX管道读取文档,“就像使用其他UNIX程序一样”他解释。所以,这个神秘的击键序列“ :r!ls”在vi中输入之后(注意,在命令模式)把“ls”的输出----当前目录的文件列表----读入到vi的缓冲区。其他UNIX程序的管道也会同样的工作。

为了在vi中自动编辑大量文件,Lasser说这就是为什么我们有“sed,awk,以及其他UNIX文本处理工具。

“文本处理是UNIX设计的一部分,而vi设计为这个系统的一部分,”Lasser写道。

也许EMACS和vi的核心问题完全不是一致性对灵活性。毕竟,所有的编辑器都提供灵活性,vi也是,它通过UNIX自身,然而EMACS的灵活性是构筑于系统层次之上的。

而且,基于这样的事实----灵活性的唯一要点在于使工作变得快些。如果你想要直接而无装饰的文本处理,你可以选择Pico,它仅仅提供一个空白的屏幕,而且不会有任何使新手混乱的特性,而像vi或EMACS都会。但是vi和EMACS两者的共同点都在于提供一些高级的方式,来减少键盘上的手指速度和编程者大脑速度的差异。

换句话说,是否这些编辑器提供着相同的东西,但是要求用户用不同的方式思考呢?Vi需要耐性去学习它古怪的操作方式,然后一旦你精通它们,你在任何UNIX系统上都获得了行动自由。EMACS赋予你疯狂的自由来自定义你认为合适的装备,然后如果你不小心,你会变成你自己配置的囚徒。

在所有优秀的程序员在提升自身效率的旅途上,偶尔,vi和EMACS用户在路口上相遇,他们本来自不同的方向。他们一相遇,通常就彼此扔石头砸对方。

这些都很好。

“我不认为在功能上有很大的差异。这两个编辑器都能把事情做得很好,and it just comes down to whatpeople learn first,”Gil写道。“一旦大多数人会EMACS,他们将教其他人EMACS。从而,大多数人使用EMACS,等等。”

然后争执又将继续……
文章评论

共有 6 条评论

  1. 594chengzhi 于 2010-04-12 23:40:05发表:

    我还是学emacs吧。。

  2. renddie 于 2009-07-27 02:02:26发表:

    刘冲出品,必属精品

  3. l460618498 于 2009-07-26 22:25:51发表:

    既有英文又有汉语的啊

  4. 刘冲 于 2009-07-26 21:40:44发表:

    引用:
    以前看过,不错不错~~
    小普林斯 发表于 2009-7-26 21:27
    林妹妹啊!:0wioe(1

  5. 小普林斯 于 2009-07-26 21:27:09发表:

    以前看过,不错不错~~

  6. 刘冲 于 2009-07-26 21:20:43发表:

    EMACS vs. vi: The endless geek 'holy war'
    By Joab Jackson on December 04, 2001 (8:00:00 AM)

    Share Print Comments

    There they went, at it again. The president of our local Linux user's group sent out the word that the week's tutorial would be canceled. That the tutorial was on using the vi text editor was enough to set off a fresh round of sniping.

    Greg Menke fired the first salvo. Use vi? How hard could that be? He emailed his own steps for using vi. They were, as follows:

    1. Procure fish, any kind, length > 12 inches
    2. Freeze it overnight
    3. Sit in front of PC, run vi
    4. Holding fish by the tail, smash it repeatedly against your forehead until you decide to give EMACS a try because the fish scales are flying around your head and it's starting to ache.

    Menke, of course, was implying that not only vi was insanely obstinate but that vi users were obstinate as well for refusing to admit how they were inflicting upon themselves frozen-fish-against-the-noggin levels of brutalization.

    It didn't take long for vi lovers return fire. One suggested Menke add this line to his instructions: "Type 'emacs' before step 1, so that by the time step 4 is done, it will have finally finished loading."

    Now, was he trying to say the EMACS text editor was slow?

    Like fight-fatigued battalions who come to a temporary truce but refuse to give up the war, vi and EMACS users keep an uneasy standoff in many Linux, SAGE and other computer-related virtual communities. It's the kind of standoff that may remain dormant for months, but it takes only the vaguest slight from one side for the flames to roil across the newsgroups and mailing lists once again. For just beneath their civil demeanors, each camp feels the editor they use is the best of all possible editors and those who use any other editor, particularly that other editor, are fools who would realize the error in their thinking if only pounded with enough mockery.

    Now, a rift over which Unix text editor is God's Own Build may not seem significant given all the troubles of the world, a Coke vs. Pepsi standoff of no consequence, no motivator beyond simple group bonding ("Go Team!").

    But why has this difference of views remained a divisor of programmer culture for more than two decades now? Why has it remained intact as the PC, graphical user interfaces, the mouse, the Internet and Open Source each altered the computation landscape?

    "As far back I can remember both, the hacker population has been split 50/50 [between] EMACS [and] vi," emails Eric Raymond, who counts as many of his roles in the Open Source software and hacker communities as a long-time observer/participant anthropologist. "Pico, joe, MicroEmacs, and other editors have basically been down in the statistical noise during the whole period." Raymond can personally date the vi/EMACS split back to 1985 and stipulates that, in all likelihood, it went on long before that.

    As early as 1991, Raymond recorded the vi vs. EMACS "holy war" in the Jargon File, perhaps the ultimate collection of hacker terminology.

    When pressed, most people familiar with both editors will say the difference between the two is one of speed vs. flexibility, with vi users pointing to how darn quickly they can move around and EMACS lovers touting their immense number of options. Vi users deride EMACS for being unnecessarily ostentatious; EMACS users derided vi for being difficult to learn and limited in scope.

    So the great text editor debate of our time comes down to the technical equivalent of "tastes great/less filling?" Well, yes, kind of. But like with all matters of religion -- or war -- the deeper you dig, the murkier the issues get.

    But there is significance here. These editors are the tabula rasa upon which much of cyberspace has been built. That these tools, each designed to be transparent to the end user, are subject to such fierce and competing loyalties, reveals something about some primordial assumptions people have about the best ways of getting things done.

    Vi: The editor that time forgot?

    At first glance, outsiders might see vi as the editor that time forgot. It's not just that you have to open up a terminal window just to use the thing. That's the best way to get to EMACS, too. But even with the VIM, the updated version most vi users employ these days, one can't help but to marvel at (or become frustrated over) the sheer lack of intuitiveness of how it works.

    Even the webmaster of the VI Lovers Home Page admits that the learning curve is steep. "Vi doesn't get fast before you know 25 commands or so," wrote Amsterdam native Thomer Gil, now working on a computer science Ph.d. at the Massachusetts Institute of Technology.

    Gil's been likened by his office-mates to a "caveman wielding ax and club" for his use of VIM.

    Of all vi's perceived shortcomings, perhaps the most noticeable is how you need to toggle the insert key just to type anything onto the screen. Vi has two modes: One is the "insert" mode where you can enter text. You get to that mode by hitting the "insert" key on the keyboard. But there is also the command mode where you can't enter text, but instead enter relevant commands. From insert mode, you can get there by hitting the escape key.

    So imagine the unsuspecting first-time user typing away who accidentally hits the escape key, only to find that not only can he longer enter text, but his keystrokes are sending the program in strange directions.

    The Jargon File dryly notes that this feature of vi "tends to frustrate new users no end, as it will neither take commands while expecting input text nor vice versa, and the default setup provides no indication of which mode the editor is in."

    "Multiple modes freak people out," Gil admits.

    Vi was written by Bill Joy in 1976, who forged it from two even more primitive editing tools, ed and ex. Vi stood for "visual interface," which in 1976 was in quite the bleeding edge in computing, according to a Joy interview in Linux Magazine.

    "I was trying to make it usable over a 300-baud modem. That's also the reason you have all these funny commands. It just barely worked to use a screen editor over a modem, " Joy said "So the editor was optimized so that you could edit and feel productive when it was painting slower than you could think."

    In that interview, Joy contrasted the development environment of vi to that of EMACS, which, he said was written for systems with blazing fiber-channel links and monster PDP-10's.

    "So they could have funny commands with the screen shimmering and all that, and meanwhile, I'm sitting at home in sort of World War II surplus housing at Berkeley with a modem and a terminal that can just barely get the cursor off the bottom line," Joy said, perhaps sounding a bit envious. "People don't know that vi was written for a world that doesn't exist anymore."

    Yet, while vi should have died out in the early '80s as network and processor speed increased, instead, it has flourished. The VI Pages lists close to 30 vi clones from elvis and VIM to such obscurities as WinVi and vigor.

    Tim O'Reilly, mastermind behind the O'Reilly & Associates publishing company noted on the company's Ask Tim column that his company sells twice as many vi books than EMACS ones. Plus, whenever O'Reilly sponsors a vi. vs. EMACS paintball game at some convention, invariably twice as many volunteers sign up to defend the honor of vi than EMACS.

    So what is the appeal? That's best described by the Cult of VI in which John Arundel writes, "Watching a vi guru doing some heavy editing on a file, as her fingers fly over the keys and textual transformations sweep across the screen, one could believe that one is in the presence of supernatural powers."

    Gil publishes a few examples of this wizardry on his Web site. "A key concept in vi is combining a certain action (delete, copy to buffer, capitalize, etc.) with a movement (go to line 25, go to end of document, go to next occurrence of 'foo,' go to 2nd occurrence of character 'x' in this line, etc.)."

    "Huh?" I email him.

    Gil sends back an example: "If, for example, a document contains the lines: 'a b c d e f g h' and the cursor is location on 'b,' then I can type 'd/f.' "

    The first "d" means delete, the "/" is a search function, so what this command will do is delete from b to f.

    "No special circumstances required to use this . . . Delete words, sentences. Go back to where I was before. 'Oh no, jump back again. Undo what I did, redo it,' " Gil writes.

    Gil stipulates you can do tricks like this one on EMACS, too. However, he says it requires memorization of unwieldy "funky Ctrl-X Ctrl-c Alt-F4 key combinations" to execute.

    Another trick Gil reveals is how VI allows users move around in files. "The stupid way is using arrow keys; there are many other, more advanced, ways to move around," Gil writes. Among the advanced forms of carriage vi offers is the option to jet to the last or last few cursor jumps, or to the next occurrence of a particular word, or to the next sentence or paragraph.

    Even the dual mode "feature" becomes transparent to users. About a year ago, A while back I interviewed Jon Lasser to write about his then-recently published book Think Unix, (the manuscript of which, he told me, was composed entirely in vi). The conversation eventually came around to vi, and I complained about the two modes.

    Lasser explained that he saw no difference between working in vi and in word processors like StarOffice or Microsoft Word. In Word, when you move your pointer out of the screen area, you can't type in text. You have, in effect, moved from insert mode to command mode. "It's the same thing," he explained.

    As O'Reilly wrote about vi: "Like a lot of things about UNIX, it only *seems* difficult."

    More is more with EMACS?

    When vi loyalist O'Reilly wrote in Ask Tim that he first shifted from EMACS to vi only after his customized EMACS profile was trashed, it was one of those subtle jabs vi users like to use against EMACS.

    EMACS stands in sharp contrast to vi's pristine limitation of commands, with its almost infinite customizability. Given human nature being what it is, however, such power in the hands of users may not always be a best thing.

    As the Emacs-Beginner-HOWTO puts it, EMACS can be a text editor, mail client, news reader, word processor, script editor, and integrated development environment for programming languages.

    The key to this is the multiple modes, each with a unique command set, that EMACS offers. Want to check email? Just flip over to the email mode. Want to writing a program in C++? Use the C++ mode. Need to author some Web pages? Flip into the html-helper mode.

    And on top of all this, you can also customize EMACS and even add new functions, usually through modifying the Lisp code.

    All of which many vi users see as terribly presumptuous for what is supposed to be a simple text editor, not to mention distracting for the user. The ongoing joke about EMACS is that it is an operating system with a text editor attached.

    "EMACS as such actually started out as a standards project," emails Guy Steele, one of the originators of EMACS, along with Richard Stallman, who later founded the Free Software Foundation.

    The way Steele recalls, Stallman maintained an early editor for PDP-10 called TECO, which stood for "Text Editor and COrrector."Although certain keystrokes would perform editing commands, Stallman created a user-programmable table "such that each keystroke performed a lookup in the table describing what to do for that keystroke," according to Steele. "One option was to execute a user-specified TECO macro."

    Using this macro functionality, users were programming custom sets of macros to be attached to various keystrokes, but this became problematic when programmers started collaborating on programs and found out they had few common keystrokes between them.

    "The user community had become fragmented with respect to the skills of text (and program) editing," Steele writes. So Steele, along with David Moon and Stallman, took on the project of integrating all the ideas into a unified command set.

    "I made up a matrix on paper and did a lot of running back and forth among the implementers and users of the various macro packages," Steele emails.

    "I remember this very well," recalls Dan Weinreb, who was one of the first alpha testers of EMACS. "Guy had a clipboard with a piece of paper showing all the key bindings, and he carefully and diplomatically collected input and comments from everyone to put together the unified, standard key bindings."

    After a few months, Steele, busy trying to finish his master's dissertation, handed the work over to Stallman. And the rest is history.

    That the flexibility was baked in from the start gives EMACS its edge, say hardcore users.

    "I think of EMACS as the Swiss Army Knife of editors," emails Debra Cameron, co-author of Learning GNU Emacs and president of Cameron Consulting. "It is a complete work environment, a microcosm. If you think of something you wish it did, you will probably find out (after looking around) that it already does it. If it doesn't, you can extend it and make it do what you wish it did."

    Can't we all just get along?

    So how does EMACS contrast to vi?

    "I have seen very adept vi users do some pretty neat tricks, but I still think vi is (just) an editor, even if for some it is a great editor," emails Cameron. "[It] always, always works the same way. In this sense, vi is like McDonald's; no matter where you go, it is exactly the same."

    "Do you want an editor that can be modified to your needs and quirks and which does many, many things or do you just want to be able to quickly edit files on any machine?" she asks. "For people who have to move around from one computer to another constantly, this consistency can be a real advantage."

    In other words, EMACS = flexibility, whereas vi = uniformity?

    Here's where things get murky.

    "EMACS is certainly more complex than vi, but I don't believe it's more powerful in any sort of useful way, because vi was designed to be part of a UNIX system and to interact with those tools," counters Jon Lasser.

    Mind you, for Lasser, "useful" means the way that vi allows you to read documents directly from a UNIX pipe from another process, "like you would in any other UNIX application," he explains. So, the arcane string of keystrokes " :r !ls" entered into vi (in command mode, remember) reads into the buffer the output from the "ls" program, or a listing of files from the current directory. And a pipe from any other UNIX program would work as well.

    As for editing a large number of files automatically in vi, Lasser says that's why we have "sed, awk, and all of the other UNIX text-processing tools.

    "Text processing is what UNIX was designed for, and vi was designed to be part of such a system," Lasser writes.

    Maybe the underlying issue between EMACS and vi isn't one of uniformity versus flexibility at all. After all, both editors offer flexibility, its just that with vi, it's through UNIX itself, whereas EMACS achieves it by building on top of the system.

    And, for that matter, the only point of flexibility anyway is to make the job go faster. If you wanted straightforward no-frills text processing, you could go with Pico, which offers just a blank screen and none of the newbie-confusing features of either vi or EMACS. What both of these editors offer are advanced ways of narrowing the gap between the speed of the fingers on the keyboard and the speed of the programmer's brain.

    In other words, could it be that these editors offer the same thing, but demand different ways of thinking from their users? Vi requires the patience to learn its quirky ways, though once you master them, you're free to take your act to any UNIX system. EMACS endows you with mad freedoms in customizing your setup as you see fit, though if you're not careful, you'll become prisoner to your own configuration.

    Sometime during the great hike of improving self-efficiency that all good programmers take, vi and EMACS users cross paths, each coming from a different direction. And when they meet, they usually throw stones at one another.

    But it's all good.

    "I don't think there is a strong difference in functionality. Both editors do a fine job and it just comes down to what people learn first," Gil writes. "Since most people know EMACS, they will teach others EMACS. Hence, most people use EMACS, etc."

    And so the feud will continue ...

    (Note: Capitalization of EMACS, UNIX and vi may have been changed in quotes to their original forms, except in direct titles of books and Web pages).