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 and Vim 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] History

Emacs is developed by GNU.

Vim is an improved clone of the original vi.

[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 injuries that prevented him from engaging in much programming activity. 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 initially steep learning curve 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

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 -- 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.

[edit] Resource Consumption

Vim is lighter than emacs and uses less memory. Only recently 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 persistant Emacs process and connect any number of clients to this process, which speeds startup time and decreases total memory usage. On the other hand, many vi/Vim proponents suggest that EMACS is an acronym for "Eighty Megabytes And Constantly Swapping" (apparently inflated for modern architectures from the old joke that Emacs stood for "Eight Megabytes And Constantly Swapping"), referring to the nontrivial memory footprint of a typical Emacs process.

[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 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 for its GUI while Vim uses other higher level GUI libraries, such as gtk, gtk2, gnome, gnome2, motif, athena, neXtaw, photon, carbon.

[edit] Buffer Tabs

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

[edit] Links

Personal tools