Vim vs Emacs

From WikiVS, the open comparison website
Jump to: navigation, search
Emacs Vim
Emacs
VS
Vim
http://www.gnu.org/software/emacs/ http://www.vim.org

Emacs (Stallman, Steele, Moon, Greenblatt, Frankston, et al., 1976) and Vim (Bram Moolenaar, 1991) are the most widely used advanced text editors in the *nix platform. They have a history of being competitors in the world of text editors because all other editors are not advanced enough for anything other than quick edits. While both feature similar power through plugins, scripting, and shortcut keys, the way these two applications approach these factors are what cause dividing walls.

Contents

[edit] Interface

Vim makes use of editing modes. The most often used modes are command mode and insert mode. Vim tries to be an editor that enables users to do something in the fewest amount of keystrokes possible. One reason for this is because the original vi was designed to be used over slow terminals.

Emacs uses modifier keys to enable shortcuts, often involving several keys being pressed at the same time to activate a single function. A common joke is that EMACS stands for "Esc-Meta-Alt-Ctrl-Shift". Notably, Richard Stallman -- one of the inventors of Emacs and the primary maintainer and developer of GNU Emacs throughout most of its lifetime -- for a number of years suffered from crippling repetitive stress injury that prevented him from engaging in much programming activity (see Links below). This is sometimes presented as evidence of the superiority of the vi/Vim interface style.

[edit] Learning Curve

Vim's multiple editing modes may be a turn-off to beginner users who do not want to spend the time to learn the different modes, because it's different from most other editors. Vim advocates argue that the initial difficulty in learning pays off in the long run by enabling far greater productivity and efficiency once the user has become skilled at use of the editor. Emacs, in this regard, has a more natural interface for users coming from many common GUI-based text editors, and its productivity enhancements tend to depend more on customization of the editor environment than on the basic design of the editor environment.

A number of jokes have been made about the comparative learning curves of various editors. Some of them, such as the image at that link, are merely exaggerations of fact.

[edit] Edit Speed at the very first launch

Users that are proficient at Vim can usually edit files faster than those who are proficient at Emacs because of Vim's purposely speed-driven interface. For instance, cursor movement can be controlled through the keys H, J, K, and L once the user is in Normal Mode (Esc or Ctrl-C) -- part of the venerable vi philosophy of never requiring the user's hands to leave "home row" position to improve efficiency. In Emacs' default interface configuration, one must move the cursor by pressing Ctrl-B or Ctrl-F, shortcuts which require two keys to be pressed simultaneously, and in turn slow the user down. Also, Emacs allows using the arrow keys for single character cursor moves. Vim also supports those same arrow keys, both in Normal Mode and in Insert Mode.

[edit] Resource Consumption

Vim is lighter than emacs and uses less memory. Only in the 2000s has the size of a typical Vim binary exceeded the storage capacity of a 1.44MB floppy disk.

With gnuclient, you can run a single persistent Emacs process and connect any number of clients to this process in a client-server operation model, which speeds startup time and decreases total memory usage, closing the gap between it and Vim a bit. Many vi/Vim proponents still suggest that EMACS is an acronym for "Eighty Megabytes And Constantly Swapping", referring to the nontrivial memory footprint of a typical Emacs process.

Modern, feature-packed vim will eat a healthy amount of memory, closing in to Emacs' respective consumption. End users with a goal of "one file per window" can make use of the server-client feature of Emacs, allowing one Emacs session act as a server for many client windows, which may provide for smaller resource consumption compared with Vim if many files are open simultaneously. Vim does allow the user to edit multiple documents in a single window at the same time, either simultaneously visible or with only one buffer visible at a time (which is functionality Emacs also provides), avoiding the resource overhead of running multiple X client windows as with the Emacs client-server feature when separate X windows are not important to the user.

[edit] Features

Vim and Emacs are very powerful editors. Both are highly scriptable and have many configuration settings to help with editing. Macros and functions help with automated edits.

[edit] Multi-byte Characters

Both Vim and Emacs support multi-byte characters, although for a long time, international characters were only available through plugins for emacs.

[edit] Extensibility

Both Vim and Emacs support plugins that enhance their functionality. Emacs can be extended in elisp, while Vim has its own internal scripting language called [VimScript] and supports use of other programming languages for plugin development.

Vim can also be extended on the fly by using the command mode. The command mode allows configuration options to be set, functions to be defined, and macros to be made. In fact, configuration files for Vim are just commands that can be input through the command mode.

Emacs advocates often point to the extreme customizability of the editor as its crowning achievement. Emacs could be said to be written in its own extension language (strictly speaking, the reverse is true: lisp supports run-time modifications of the running instance, and modifications automatically work and are incorporated if they are syntactically correct). As a result, Emacs can be extended on the fly by redefining built-in elisp functions, either by typing the new definition into Emacs or by loading elisp files. Groups of related changes are typically called "modes", and can be easily configured to be automatically used for particular types of files(buffers), say for different programming languages or frameworks such as "lisp mode" or "Ruby mode" or "Rails mode". Since these can directly modify even core behaviours of Emacs, or automatically format or colorize text and add standard template or "boilerplate" text such as function declarations and closures, users typically find Emacs to be far more customisable to their particular requirements than is Vim. In particular, Emacs users who spend most of their time in a single "environment" or task-type find themselves able to precisely customise their normal environment to their preferred workflow in any respect important to them. Much of Emacs's devoted following stems from this ability.

[edit] Graphical Interface

Both Vim and Emacs have graphical user interfaces. While the graphical interface provides menus for both applications, virtually all menu items are just different ways to handle a shortcut command or quick configuration. There is almost nothing that can be done on the graphical user interface that cannot be done through direct commands and shortcut keys for both editors.

Emacs uses XDisplay or gtk2 for its GUI. Vim is able to use many other GUI libraries, such as gtk, gtk2, gnome, gnome2, motif, athena, neXtaw, photon, carbon.

It should be noted that Emacs can display graphics and different fonts in a window. GVim is limited to one font that must be fixed width.

[edit] Buffer Tabs

Both Vim and Emacs have support for buffer tabs in both the CLI and the GUI.

[edit] Misc

Vim is often available on servers, to be used through ssh.

[edit] Associated Operating System and License

GNU Emacs is licensed with the GNU GPL, and is much more commonly associated with the GNU/Linux operating system, given the fact that it is a part of the GNU project. Vim's license is defined as charityware, although the author states it is GPL compatible. Vim was also originally based on vi, which was first written by Bill Joy, and although Vim is used by many GNU/Linux users, it could therefore be considered native to the BSDs; a maintained "nvi" variant is the default text editor for FreeBSD.

[edit] Links

See Also the Following Articles

Personal tools
Namespaces
Variants
Actions
Navigation
Ads
Toolbox