eMacs vs Vim: differences between vi and Emacs

There has been a long-standing rivalry between users of the vi and Emacs text editors. The rivalry has become a lasting part of hacker culture and the free software community. Many flame wars have been fought between groups insisting that their editor of choice is the paragon of editing perfection, and insulting the others. Unlike the related battles over operating systems, programming languages, and even source code indent style, choice of editor usually only affects oneself.

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 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. Fortunately, sane emacs users typically just use the arrow keys for single character cursor moves and save the key combinations for moving across large documents.

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. Historically, vi is a smaller and faster program, with a more limited capacity for customization. Emacs takes longer to start up and requires 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.

Benefits of vi-like editors

  • Historically, is faster than Emacs.
  • Runs on all systems that can implement the standard C library, including UNIX, Linux, AmigaOS, DOS, Windows, Mac, BeOS, and POSIX-compliant systems.
  • Allows users of the QWERTY keyboard to keep their fingers on the home row, thus requiring less movement to edit.
  • Ubiquitous. Essentially all Unix and Unix-like systems come with vi (or a variant) built-in.

Benefits of Emacs

  • One of the most ported non-trivial computer programs. It runs on a wide variety of operating systems, including most Unix-like systems (GNU/Linux, the various BSDs, Solaris, AIX, IRIX, AmigaOS, Mac OS X etc.), MS-DOS, Microsoft Windows and OpenVMS. Unix systems, both free and proprietary, frequently provide Emacs bundled with the operating system.
  • Extensible and customizable (Lisp programming language variant – Emacs Lisp), with features that include:
    • Ability to emulate vi (known as “viper-mode”).
    • A powerful and extensible file manager (dired), integrated debugger, and a large set of tools to work with.

Our opinion

For new users it might be best to start with nano, and if they are ready for a whopping 15 minutes of learning, they can move to vi. Vi is really not that hard, I use it a lot and it works pretty great compared to nano and the editor that shall not be named. It was made for quick editing and it’s just… very easy, you only need to know 10 commands or so and you can do pretty much everything.

Leave a Reply