Editor war

Last updated

The editor war is the rivalry between users of the Emacs and vi (now usually Vim, or more recently Neovim) text editors. The rivalry has become an enduring part of hacker culture and the free software community.

Contents

The Emacs versus vi debate was one of the original "holy wars" conducted on Usenet groups, [1] with many flame wars fought between those insisting that their editor of choice is the paragon of editing perfection, and insulting the other, since at least 1985. [2] Related battles have been fought over operating systems, programming languages, version control systems, and even source code indent style. [3] [4]

Comparison

Differences between vi and Emacs are presented in the following table:

Features of Emacs and vi
FeatureEmacsvi
Keystroke executionTraditionally, [notes 1] Emacs commands are key combinations for which modifier keys are held down while other keys are pressed; a command gets executed once completely typed. This still forms a decision tree of commands, but not one of individual keystrokes.vi retains each permutation of typed keys (e.g. order matters). This creates a path in the decision tree which unambiguously identifies any command.
Memory usage and customizabilityEmacs executes many actions on startup, many of which may execute arbitrary user code. [5] This makes Emacs take longer to start up (even compared to vim) and require more memory. However, it is highly customizable and includes a large number of features, as it is essentially an execution environment for a Lisp program designed for text-editing. Emacs 18 (released in 1987) introduced a server mode [6] designed to run continuously in the background. Various instances of Emacs can then be started in client mode, attaching to this server and sharing state. Emacs client startup time is practically instantaneous as all it does is invoke the existing Emacs process to redraw the display.vi is a smaller and faster program, but with less capacity for customization. vim has evolved from vi to provide significantly more functionality and customization than vi, making it comparable to Emacs. [notes 2] vi start-up time is near instantaneous for small text files, while vim is almost as fast.
User environmentEmacs, while also initially designed for use on a console, had X11 GUI support added in Emacs 18, and made the default in version 19. Current Emacs GUIs include full support for proportional spacing and font-size variation. Emacs also supports embedded images and hypertext.vi, like emacs, was originally exclusively used inside of a text-mode console, offering no graphical user interface (GUI). Many modern vi derivatives, e.g. MacVim and gVim, include GUIs. However, support for proportionally spaced fonts remains absent. Also lacking is support for different sized fonts in the same document. [9]
Function/navigation interfaceEmacs uses metakey chords. [notes 3] Keys or key chords can be defined as prefix keys, which put Emacs into a mode where it waits for additional key presses that constitute a key binding. Key bindings can be mode-specific, further customizing the interaction style. Emacs provides a command line accessed by M-x that can be configured to autocomplete in various ways. Emacs also provides a defalias macro, allowing alternate names for commands.vi uses distinct editing modes. Under "insert mode", keys insert characters into the document. Under "normal mode" (also known as "command mode", not to be confused with "command-line mode", which allows the user to enter commands), bare keypresses execute vi commands.
KeyboardThe expansion of one of Emacs' backronyms is Escape, Meta, Alt, Control, Shift, which neatly summarizes most of the modifier keys it uses, only leaving out Super. Emacs was developed on Space-cadet keyboards that had more key modifiers than modern layouts. There are multiple emacs packages, such as spacemacs [11] or ergoemacs [12] that replace these key combinations with ones easier to type, or customization can be done ad hoc by the user.vi does not use the Alt key and seldom uses the Ctrl key. vi's keyset is mainly restricted to the alphanumeric keys, and the escape key. This is an enduring relic of its teletype heritage, but has the effect of making most of vi's functionality accessible without frequent awkward finger reaches.
Language and script supportEmacs has full support for all Unicode-compatible writing systems and allows multiple scripts to be freely intermixed. [13] vi has rudimentary support for languages other than English. Modern Vim supports Unicode if used with a terminal that supports Unicode.

Benefits of Emacs

Benefits of vi

Evolution

Editor choice being brought up during a presentation at a technology convention. 2012 SOTM Steve Coast (8091880545).jpg
Editor choice being brought up during a presentation at a technology convention.

Many small editors that were based on or derived from vi in the past were successful. This was because it was crucial to preserve the memory that was, at the time, relatively sparsely available. As computers have become more powerful, many vi clones, Vim in particular, have grown in size and code complexity. These vi variants of today, as with the old lightweight Emacs variants, tend to have many of the perceived benefits and drawbacks of the opposing side. For example, Vim without any extensions requires about ten times the disk space required by vi, and recent versions of Vim can have more extensions and run slower than Emacs. In The Art of Unix Programming , Eric S. Raymond called Vim's supposed light weight when compared with Emacs "a shared myth". [23] Moreover, with the large amounts of RAM in modern computers, both Emacs and vi are lightweight compared to large integrated development environments such as Eclipse, which tend to draw derision from Emacs and vi users alike.

Tim O'Reilly said, in 1999, that O'Reilly Media's tutorial on vi sells twice as many copies as that on Emacs (but noted that Emacs came with a free manual). [24] Many programmers use either Emacs and vi or their various offshoots, including Linus Torvalds who uses MicroEMACS. [25] Also in 1999, vi creator Bill Joy said that vi was "written for a world that doesn't exist anymore" and stated that Emacs was written on much more capable machines with faster displays 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". [26] [27]

In addition to Emacs and vi workalikes, pico and its free and open-source clone nano and other text editors such as ne often have their own third-party advocates in the editor wars, though not to the extent of Emacs and vi.

As of 2020, both Emacs and vi can lay claim to being among the longest-lived application programs of all time, [28] as well as being the two most commonly used text editors on Linux and Unix. [29] Many operating systems, especially Linux and BSD derivatives, bundle multiple text editors with the operating system to cater to user demand. For example, a default installation of macOS contains ed, pico (nano before MacOS Ventura 12.3), TextEdit, and Vim. Frequently, at some point in the discussion, someone will point out that ed is the standard text editor. [30]

Humor

Richard Stallman appearing as St IGNU-cius, a saint in the Church of Emacs Richard Stallman - Preliminares 2013.jpg
Richard Stallman appearing as St IGNU−cius, a saint in the Church of Emacs

The Church of Emacs, [31] formed by Emacs and the GNU Project's creator Richard Stallman, is a parody religion. [32] While it refers to vi as the "editor of the beast" (vi-vi-vi being 6-6-6 in Roman numerals), it does not oppose the use of vi; rather, it calls proprietary software anathema. ("Using a free version of vi is not a sin but a penance." [33] ) The Church of Emacs has its own newsgroup, alt.religion.emacs, that has posts purporting to support this belief system.

Stallman has referred to himself as St IGNU−cius, a saint in the Church of Emacs. [34]

Supporters of vi have created an opposing Cult of vi, argued by the more hard-line Emacs users to be an attempt to "ape their betters".[ citation needed ]

Regarding vi's modal nature (a common point of frustration for new users) [35] some Emacs users joke that vi has two modes – "beep repeatedly" and "break everything". vi users enjoy joking that Emacs's key-sequences induce carpal tunnel syndrome, or mentioning one of many satirical expansions of the acronym EMACS, such as "Escape Meta Alt Control Shift" (a jab at Emacs's reliance on modifier keys) [36] or "Eight Megabytes And Constantly Swapping" (in a time when that was a great amount of memory) or "EMACS Makes Any Computer Slow" (a recursive acronym like those Stallman uses) [37] or "Eventually Munches All Computer Storage", in reference to Emacs's high system resource requirements. GNU EMACS has been expanded to "Generally Not Used, Except by Middle-Aged Computer Scientists" referencing its most ardent fans, and its declining usage among younger programmers compared to more graphically oriented editors such as Atom, BBEdit, Sublime Text, TextMate, and Visual Studio Code.[ citation needed ]

As a poke at Emacs' creeping featurism, vi advocates have been known to describe Emacs as "a great operating system, lacking only a decent editor". Emacs advocates have been known to respond that the editor is actually very good, but the operating system could use improvement (referring to Emacs' famous lack of concurrency, which has now been added [38] ).

A game among UNIX users, either to test the depth of an Emacs user's understanding of the editor or to poke fun at the complexity of Emacs, involved predicting what would happen if a user held down a modifier key (such as Ctrl or Alt ) and typed their own name. This game humor originated with [39] users of the older TECO editor, which was the implementation basis, via macros, of the original Emacs.

Due to how one exits vi (":q", among others), hackers joke about a proposed method of creating a pseudorandom character sequence by having a user unfamiliar with vi seated in front of an open editor and asking them to exit the program.[ citation needed ]

The Google search engine also joined in on the joke by having searches for vi resulting in the question "Did you mean: emacs" prompted at the top of the page, and searches for emacs resulting in "Did you mean: vi". [40]

In the web series A Murder at the End of the World, there is a scene referencing the editor wars where a character asks a woman if she uses Vi or Emacs. [41]

See also

Notes

  1. Nowadays both editors provide easy ways to implement each other's keybindings. In Emacs, Vim keybindings are implemented via Evil mode, while in Vim, Emacs keybindings are implemented through the Vimacs package. Although Vim keybindings are popular for its ergonomics, the arguably most ergonomical key on a keyboard i.e. the space bar is not used in Vim. A popular alternative to the Emacs and Vim ways of navigation was implemented via Spacemacs, which is a popular Emacs configuration that leverages the space bar to function as the main key for control and navigation. The idea of Spacemacs has also been ported to Vim through Spacevim.
  2. As of 2013 vim has 1731 kLOC of code (1142 in C + 506 stock distro vimScript + 83 makefile-related), whereas GNU Emacs has 1623 (just 299 in C + 1270 stock distro Emacs Lisp + 54 makefile-related). [7] [8] There are many optional Emacs Lisp (and Vimscript) packages available; the numbers here refer to only code which is actually included in the main download of the respective editor.
  3. Emacs also has something called "modes"; however, in Emacs these generally refer to long-term interaction states that apply for entire time one works with a given file or dataset, which is not the definition of modal interface per se. [10]

Related Research Articles

<span class="mw-page-title-main">Bash (Unix shell)</span> GNU replacement for the Bourne shell

Bash is a Unix shell and command language written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell. The shell's name is an acronym for Bourne-Again SHell, a pun on the name of the Bourne shell that it replaces and the notion of being "born again". First released in 1989, it has been used as the default login shell for most Linux distributions and it was one of the first programs Linus Torvalds ported to Linux, alongside GCC. It is available on nearly all modern operating systems.

<span class="mw-page-title-main">Emacs Lisp</span> Dialect of Lisp used as the primary implementation and extension language for Emacs

Emacs Lisp is a dialect of the Lisp programming language used as a scripting language by Emacs. It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C, as is the Lisp interpreter. Emacs Lisp is also termed Elisp, although there are also older, unrelated Lisp dialects with that name.

<span class="mw-page-title-main">GNU</span> Free software collection

GNU is an extensive collection of free software, which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operating systems popularly known as Linux. Most of GNU is licensed under the GNU Project's own General Public License (GPL).

An integrated development environment (IDE) is a software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, and a debugger. Some IDEs, such as IntelliJ IDEA, Eclipse and Lazarus contain the necessary compiler, interpreter or both; others, such as SharpDevelop and NetBeans, do not.

<span class="mw-page-title-main">Vim (text editor)</span> Improved version of the Vi keyboard-oriented text editor

Vim is a free and open-source, screen-based text editor program. It is an improved clone of Bill Joy's vi. Vim's author, Bram Moolenaar, derived Vim from a port of the Stevie editor for Amiga and released a version to the public in 1991. Vim is designed for use both from a command-line interface and as a standalone application in a graphical user interface. Since its release for the Amiga, cross-platform development has made it available on many other systems. In 2018, it was voted the most popular editor amongst Linux Journal readers; in 2015 the Stack Overflow developer survey found it to be the third most popular text editor, and in 2019 the fifth most popular development environment.

vi (text editor) Keyboard-oriented text editor

vi is a screen-oriented text editor originally created for the Unix operating system. The portable subset of the behavior of vi and programs based on it, and the ex editor language supported within these programs, is described by the Single Unix Specification and POSIX.

<span class="mw-page-title-main">XEmacs</span>

XEmacs is a graphical- and console-based text editor which runs on almost any Unix-like operating system as well as Microsoft Windows. XEmacs is a fork, based on a version of GNU Emacs from the late 1980s. Any user can download, use, and modify XEmacs as free software available under the GNU General Public License version 2 or any later version.

<span class="mw-page-title-main">GNU Project</span> Free software project

The GNU Project is a free software, mass collaboration project announced by Richard Stallman on September 27, 1983. Its goal is to give computer users freedom and control in their use of their computers and computing devices by collaboratively developing and publishing software that gives everyone the rights to freely run the software, copy and distribute it, study it, and modify it. GNU software grants these rights in its license.

In computer programming, indentation style is a convention, a.k.a. style, governing the indentation of blocks of source code that is generally intended to convey structure.

Incompatible Timesharing System (ITS) is a time-sharing operating system developed principally by the MIT Artificial Intelligence Laboratory, with help from Project MAC. The name is the jocular complement of the MIT Compatible Time-Sharing System (CTSS).

<i>Dunnet</i> (video game) 1982 video game

Dunnet is a surreal, cyberpunk text adventure written by Ron Schnell, based on a game he wrote in 1982. The name is derived from the first three letters of dungeon and the last three letters of ARPANET. It was first written in Maclisp for the DECSYSTEM-20, then ported to Emacs Lisp in 1992. Since 1994 the game has shipped with GNU Emacs; it also has been included with XEmacs.

<span class="mw-page-title-main">Incremental search</span> User interface method to search for text

In computing, incremental search, also known as hot search, incremental find or real-time suggestions, is a user interface interaction method to progressively search for and filter through text. As the user types text, one or more possible matches for the text are found and immediately presented to the user. This immediate feedback often allows the user to stop short of typing the entire word or phrase they were looking for. The user may also choose a closely related option from the presented list.

This article provides basic comparisons for notable text editors. More feature details for text editors are available from the Category of text editor features and from the individual products' articles. This article may not be up-to-date or necessarily all-inclusive.

In computing, minimalism refers to the application of minimalist philosophies and principles in the design and use of hardware and software. Minimalism, in this sense, means designing systems that use the least hardware and software resources possible.

<span class="mw-page-title-main">Richard Stallman</span> American free software activist and GNU Project founder (born 1953)

Richard Matthew Stallman, also known by his initials, rms, is an American free software movement activist and programmer. He campaigns for software to be distributed in such a manner that its users have the freedom to use, study, distribute, and modify that software. Software that ensures these freedoms is termed free software. Stallman launched the GNU Project, founded the Free Software Foundation (FSF) in October 1985, developed the GNU Compiler Collection and GNU Emacs, and wrote all versions of the GNU General Public License.

Super key (❖) is an alternative and older name for what is commonly labelled as the Windows key or Command key on modern keyboards, typically bound and handled as such by Linux and BSD operating systems and software today.

ne (text editor) Text editor for POSIX operating systems

ne is a console text editor for POSIX computer operating systems such as Linux or Mac OS X. It uses the terminfo library, but it can also be compiled using a bundled copy of the GNU termcap implementation. There is also a Cygwin version. It was developed by Sebastiano Vigna of the University of Milan.

<span class="mw-page-title-main">GNU Emacs</span> GNU version of the Emacs text editor

GNU Emacs is a free software text editor. It was created by GNU Project founder Richard Stallman, based on the Emacs editor developed for Unix operating systems. GNU Emacs has been a central component of the GNU project and a flagship project of the free software movement. Its tag line is "the extensible self-documenting text editor."

Emacs, originally named EMACS, is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant, GNU Emacs, describes it as "the extensible, customizable, self-documenting, real-time display editor". Development of the first Emacs began in the mid-1970s, and work on GNU Emacs, directly descended from the original, is ongoing; its latest version is 29.2, released January 2024.

References

  1. "Holy War (Hacker Jargon)". Archived from the original on 2012-04-02. Retrieved 2016-11-30.
  2. "EMACS vs. vi: The endless geek 'holy war'". Archived from the original on 2016-11-30. Retrieved 2016-11-30.
  3. "Just Let Me Code". Archived from the original on 2015-05-01. Retrieved 2015-04-24.
  4. "Why Coding Style Matters". Archived from the original on 2015-05-03. Retrieved 2015-04-24.
  5. "Startup Summary".
  6. "NEWS.18". Archived from the original on 2015-06-14. Programs such as mailers that invoke "the editor" as an inferior to edit some text can now be told to use an existing Emacs process instead of creating a new editor.
  7. "The GNU Emacs Open Source Project on Open Hub : Languages Page". Ohloh.net. Archived from the original on 8 November 2013. Retrieved 1 December 2014.
  8. "The Vim Open Source Project on Open Hub : Languages Page". Ohloh.net. Archived from the original on 8 November 2013. Retrieved 1 December 2014.
  9. "syntax.txt". All fonts used, except for Menu and Tooltip, should be of the same character size as the default font! Otherwise redrawing problems will occur.[ permanent dead link ]
  10. "EmacsWiki: Category Modes". Emacswiki.org. Retrieved 1 December 2014.
  11. "spacemacs". GitHub .
  12. "Ergoemacs".
  13. "International Chars". Internally, Emacs uses its own multibyte character encoding, which is a superset of the Unicode standard. This internal encoding allows characters from almost every known script to be intermixed in a single buffer or string. Emacs translates between the multibyte character encoding and various other coding systems when reading and writing files, and when exchanging data with subprocesses.
  14. "(Emacs) Keyboard Shortcuts for Editing Text Fields in OS X".
  15. "Carbon Emacs Package". Archived from the original on 2007-03-14. Retrieved 2006-09-27.
  16. "Aquamacs is an easy-to-use, Mac-style Emacs for Mac OS X" . Retrieved 2006-09-27.
  17. B, Ramprasad (2005-06-24). "GNU Emacs FAQ For Windows 95/98/ME/NT/XP and 2000" . Retrieved 2006-09-27.
  18. Borgman, Lennart (2006). "EmacsW32 Home Page". Archived from the original on 2007-03-06. Retrieved 2006-09-27.
  19. "GNU Emacs on Windows". Franz Inc. 2006. Retrieved 2006-09-27.
  20. "Evil - Home - Open wiki". gitorious.org. May 29, 2014. Archived from the original on September 16, 2014. Retrieved September 16, 2014.
  21. Kozlowski, Mike. "Why Atom Can't Replace Vim" . Retrieved 7 May 2014.
  22. "vi". pubs.opengroup.org. Retrieved 2017-03-11.
  23. "The Right Size for an Editor". Catb.org. Retrieved 1 December 2014.
  24. "Editor: vi or emacs?". Oreilly.com. 21 June 1999. Archived from the original on 1 April 2014. Retrieved 1 December 2014.
  25. Jarosław Rzeszótko. "Stifflog: Stiff asks, great programmers answer". Stifflog.com. Archived from the original on 8 November 2006. Retrieved 1 December 2014.
  26. Vance, Ashlee (September 11, 2003). "Bill Joy's greatest gift to man – the vi editor". theregister.co.uk. Archived from the original on June 3, 2014. Retrieved June 3, 2014.
  27. Joy, Bill (November 1999). "The Joy of Unix: Sun Microsystems Co-Founder Bill Joy Charts Where Linux and Free Software Fit Into His Company's Solar System". Linux Magazine (Interview). Interviewed by Eugene Eric Kim. Archived from the original on February 7, 2003. Retrieved June 3, 2014.{{cite interview}}: CS1 maint: unfit URL (link)
  28. Auerbach, David (9 May 2014). "The Oldest Rivalry in Computing". Slate . two rival programs can stake a claim to being among the longest-lived applications of all time. Both programs are about to enter their fifth decades. Both programs are text editors, for inputting and editing code, data files, raw HTML Web pages, and anything else. And they are mortal enemies.
  29. "Choosing an Editor". these two editors express sharply contrasting design philosophies, but both are extremely popular and command great loyalty from identifiable core user populations. Surveys of Unix programmers consistently indicate about a 50/50 split between them, with all other editors barely registering.
  30. "Ed, man! !man ed". Gnu.org. Retrieved 1 December 2014.
  31. "Rules, Sins, Virtues, Gods and more of The Church of Emacs". Gnu.org. Retrieved 1 December 2014.
  32. "Saint IGNUcius - Richard Stallman". Stallman.org. Archived from the original on 22 November 2014. Retrieved 1 December 2014.
  33. "The unabridged selective transcript of Richard M Stallman's talk at the ANU". Linuxhelp.blogspot.com. Archived from the original on 4 October 2011. Retrieved 1 December 2014.
  34. "Saint IGNUcius - Richard Stallman". Stallman.org. Retrieved 1 December 2014.
  35. "vi (Hacker Jargon)".
  36. "Some funny acronym expansions of Emacs". Gnu.org. Archived from the original on February 16, 2021. Retrieved 1 December 2014.
  37. Rösler, Wolfram. "The Unix Acronym List". Archived from the original on February 16, 2021. Retrieved March 4, 2021.
  38. "Concurrency has landed (was: Please test the merge of the concurrency br". lists.gnu.org. Retrieved 2020-12-08.
  39. "Real Programmers Don't Use PASCAL". Datamation: 263–265. July 1983.
  40. "Google suggest vi for Emacs and Emacs for vi | Hacker News". Hacker News. Retrieved 2022-04-07.
  41. "A Murder at the End of the World: Are you Vi or Emacs?". xenodium.com. Retrieved 2023-12-26.