Editor war

From HandWiki
Revision as of 15:47, 6 February 2024 by TextAI2 (talk | contribs) (add)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Short description: Rivalry between Emacs and vi text editors

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.

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

The most important historical[notes 1] differences between vi and Emacs are presented in the following table:

Features of Emacs and vi
Feature Emacs vi
Keystroke execution Traditionally,[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 customizability Emacs 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 environment Emacs, 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 proportionate 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 interface Emacs 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.
Keyboard The 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 key and seldom uses the 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 support Emacs 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

  • Emacs has a non-modal interface
  • Non-modal nature of Emacs keybindings makes it practical to be supported as OS-wide keybindings.[14]
  • One of the most ported computer programs. It runs in text mode and under graphical user interfaces on a wide variety of operating systems, including most Unix-like systems (Linux, the various BSDs, Solaris, AIX, IRIX, macOS[15][16] etc.), MS-DOS, Microsoft Windows,[17][18][19] AmigaOS, and OpenVMS. Unix systems, both free and proprietary, frequently provide Emacs bundled with the operating system.
  • Emacs server architecture allows multiple clients to attach to the same Emacs instance and share the buffer list, kill ring, undo history and other state.
  • Pervasive online help system with keybindings, functions and commands documented on the fly.
  • Extensible and customizable Lisp programming language variant (Emacs Lisp), with features that include:
    • Ability to emulate vi and vim (using Evil,[20] Viper or Vimpulse).
    • A powerful and extensible file manager (dired), integrated debugger, and a large set of development and other tools.
    • Having every command be an Emacs Lisp function enables commands to DWIM (Do What I Mean) by programmatically responding to past actions and document state. For example, a switch-or-split-window command could switch to another window if one exists, or create one if needed. This cuts down on the number of keystrokes and commands a user must remember.
    • "An OS inside an OS". Emacs Lisp enables Emacs to be programmed far beyond editing features. Even a base install contains several dozen applications, including two web browsers, news readers, several mail agents, four IRC clients, a version of ELIZA, and a variety of games. All of these applications are available anywhere Emacs runs, with the same user interface and functionality. Starting with version 24, Emacs includes a package manager, making it easy to install additional applications including alternate web browsers, EMMS (Emacs Multimedia System), and more. Also available are numerous packages for programming, including some targeted at specific language/library combinations or coding styles.

Benefits of vi

  • Vi has a modal interface
  • Edit commands are composable[21]
  • Vi loads faster than Emacs.
  • Being deeply associated with UNIX tradition, it runs on all systems that can implement the standard C library, including UNIX, Linux, AmigaOS, DOS, Windows, Mac, BeOS, OpenVMS, IRIX, AIX, HP-UX, BSD and POSIX-compliant systems.
  • Vim and neovim are extensible and customizable through Vim script or APIs for interpreted languages such as Python, Ruby, Perl, and Lua.
  • Ubiquitousness. Essentially all Unix and Unix-like systems come with vi (or a variant) built-in. Vi (and ex, but not vim) is specified in the POSIX standard.[22]
  • System rescue environments, embedded systems (notably those with BusyBox) and other constrained environments often include vi, but not emacs.

Evolution

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

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 or ) 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. 1.0 1.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]

References

  1. "Holy War (Hacker Jargon)". https://www.techfak.uni-bielefeld.de/~joern/jargon/holywars.HTML. 
  2. "EMACS vs. vi: The endless geek 'holy war'". https://www.linux.com/news/emacs-vs-vi-endless-geek-holy-war. 
  3. "Just Let Me Code". http://www.drdobbs.com/tools/just-let-me-code/240168735. 
  4. "Why Coding Style Matters". http://www.smashingmagazine.com/2012/10/25/why-coding-style-matters/. 
  5. "Startup Summary". https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html. 
  6. "NEWS.18". https://searchcode.com/codesearch/view/364358/. "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. http://www.ohloh.net/p/emacs/analyses/latest/languages_summary. 
  8. "The Vim Open Source Project on Open Hub : Languages Page". Ohloh.net. http://www.ohloh.net/p/vim/analyses/latest/languages_summary. 
  9. "syntax.txt". ftp://ftp.tuwien.ac.at/.vhost/www.vim.org/vim/doc/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." [yes|permanent dead link|dead link}}]
  10. "EmacsWiki: Category Modes". Emacswiki.org. http://www.emacswiki.org/emacs/CategoryModes. 
  11. "spacemacs". https://github.com/syl20bnr/spacemacs. 
  12. "Ergoemacs". http://ergoemacs.org/. 
  13. "International Chars". https://www.gnu.org/software/emacs/manual/html_node/emacs/International-Chars.html#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". https://jblevins.org/log/kbd. 
  15. "Carbon Emacs Package". http://homepage.mac.com/zenitani/emacs-e.html. 
  16. "Aquamacs is an easy-to-use, Mac-style Emacs for Mac OS X". http://aquamacs.org/. 
  17. B, Ramprasad (2005-06-24). "GNU Emacs FAQ For Windows 95/98/ME/NT/XP and 2000". https://www.gnu.org/software/emacs/windows/ntemacs.html. 
  18. Borgman, Lennart (2006). "EmacsW32 Home Page". http://ourcomments.org/Emacs/EmacsW32.html. 
  19. "GNU Emacs on Windows". Franz Inc.. 2006. http://www.franz.com/emacs/. 
  20. "Evil - Home - Open wiki". gitorious.org. May 29, 2014. https://gitorious.org/evil/pages/Home. 
  21. Kozlowski, Mike. "Why Atom Can't Replace Vim". https://medium.com/p/433852f4b4d1. 
  22. "vi". http://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html. 
  23. "The Right Size for an Editor". Catb.org. http://www.catb.org/esr/writings/taoup/html/ch13s03.html. 
  24. "Editor: vi or emacs?". Oreilly.com. 21 June 1999. http://oreilly.com/pub/a/oreilly/ask_tim/1999/unix_editor.html. 
  25. Jarosław Rzeszótko. "Stifflog: Stiff asks, great programmers answer". Stifflog.com. http://www.stifflog.com/2006/10/16/stiff-asks-great-programmers-answer/. 
  26. Vance, Ashlee (September 11, 2003). "Bill Joy's greatest gift to man – the vi editor". theregister.co.uk. https://www.theregister.co.uk/2003/09/11/bill_joys_greatest_gift/. 
  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.CS1 maint: unfit url (link)
  28. Auerbach, David (9 May 2014). "The Oldest Rivalry in Computing". http://www.slate.com/articles/technology/bitwise/2014/05/oldest_software_rivalry_emacs_and_vi_two_text_editors_used_by_programmers.html. "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". http://www.catb.org/esr/writings/taoup/html/ch15s02.html. "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. https://www.gnu.org/fun/jokes/ed.msg.html. 
  31. "Rules, Sins, Virtues, Gods and more of The Church of Emacs". Gnu.org. https://www.gnu.org/fun/jokes/gospel.html. 
  32. "Saint IGNUcius - Richard Stallman". Stallman.org. http://stallman.org/saint.html. 
  33. "The unabridged selective transcript of Richard M Stallman's talk at the ANU". Linuxhelp.blogspot.com. http://linuxhelp.blogspot.com/2006/04/unabridged-selective-transcript-of.html. 
  34. "Saint IGNUcius - Richard Stallman". Stallman.org. http://www.stallman.org/saint.html. 
  35. "vi (Hacker Jargon)". https://www.techfak.uni-bielefeld.de/~joern/jargon/vi.HTML. 
  36. "Some funny acronym expansions of Emacs". Gnu.org. https://www.gnu.org/fun/jokes/gnuemacs.acro.exp.html. 
  37. Rösler, Wolfram. "The Unix Acronym List". http://www.roesler-ac.de/wolfram/acro/Cmd.htm#_E. 
  38. "Concurrency has landed (was: Please test the merge of the concurrency br". https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00378.html. 
  39. "Real Programmers Don't Use PASCAL". Datamation: 263–265. July 1983. 
  40. "Google suggest vi for Emacs and Emacs for vi | Hacker News". https://news.ycombinator.com/item?id=25371017. 
  41. "A Murder at the End of the World: Are you Vi or Emacs?". https://xenodium.com/are-you-vi-or-emacs/. 

External links