From: jbw@bigbird.bu.edu (Joe Wells)
Newsgroups: alt.religion.emacs
Subject: lighter fluid
Date: 13 Oct 92 16:51:48 GMT
Organization: Boston University Computer Science Department

This group has been kind of quiet lately.  This should help.


		Why should I use GNU Emacs instead of vi?


Although vi is available on almost all Unix computers there are a number
of reasons why you might want to use GNU Emacs:

* GNU Emacs comes with a complete manual available online with a hypertext
  viewing facility.

* GNU Emacs has numerous other help facilities: a tutorial; commands to
  describe functions, variables, keybindings, major modes; commands to
  look up commands, functions, and variables by patterns in their names.

* GNU Emacs does multiple windows even on dumb terminals.  You can look
  at many different places in one file in different windows.  You can
  split the screen horizontally or vertically, as many times as there is
  space on the screen.

* GNU Emacs runs under several window systems and has mouse support.

* GNU Emacs has less mode confusion than vi, where you have to remember
  whether or not you're in "insert" mode.  New users find this less
  confusing.  (Please folks, don't try to tell people that Emacs is
  "modeless".  That's just plain false.)  (Some versions of vi can be told
  to display a string in the corner of the screen indicating which mode is
  active.)

* There is no arbitrary limit on the number of files GNU Emacs can edit
  simultaneously.

* GNU Emacs correctly edits binary files, including files with NUL
  characters (ASCII code 0) and files with arbitrarily long lines (or no
  newline characters at all).

* GNU Emacs displays the screen in an unambiguous manner; you can always
  know where the line breaks are.  (However, tab characters are not
  unambiguously displayed!  Arrgh!)

* GNU Emacs saves up-to-date "autosave" copies of files on which you are
  working every 300 (user-configurable) keystrokes.  It also does this
  automatically if the terminal connection is lost.

* GNU Emacs keeps backup copies of files it saves, and can be told to keep
  any number of older versions of a file.

* GNU Emacs provides unlimited undo capabilities.  By default Emacs keeps
  at least 15000 (user-configurable) and not more than 20000
  (user-configurable) bytes worth of undo data per buffer.  (Since undo
  data is only discarded at garbage-collection time, you temporarily can
  have much more undo data available.)

* GNU Emacs saves the last 30 (user-configurable) items you have deleted
  for later recall.

* GNU Emacs automatically does locking on modified files and will warn
  users trying to edit the same file.  (WARNING: This has never been
  fixed to work across NFS file systems.  It also doesn't work on systems
  with short file names like losing System V.)

* GNU Emacs warns you if the file you are about to write has changed
  since you read it in.  When you work at multiple terminals or multiple
  windows within a terminal, or when you work with other people on a
  single source file, this can prevent you from trashing valuable
  changes.

* GNU Emacs allows *all* of its keybindings to be changed.

* GNU Emacs has an extension language, Emacs Lisp, and in fact is
  largely written in this language, so it is easy to change (and fix if
  necessary).

* GNU Emacs has an interactive debugger for Emacs Lisp.

* GNU Emacs comes with source code so you aren't vulnerably dependent on
  your vendor.

* GNU Emacs is free and can be shared with anyone.

* GNU Emacs provides a more complete software development environment.
  For example, M-x compile, M-x grep, M-x shell, etc.

* After doing a M-x compile, GNU Emacs can parse the error messages in
  the output and visit the appropriate lines of the appropriate files.

* GNU Emacs can record your keystrokes into keyboard macros.

* GNU Emacs provides many mechanisms to reduce your need to remember and
  type long names.  For example, abbrevs (abbreviations you define),
  dynamic abbrevs (look for similar things already in the buffer),
  program identifier completion, filename completion, etc.

* GNU Emacs provides "major modes" that are custom tailored for each
  different editing need, for example: C, C++, Indented Text, Outline,
  TeX, Nroff, etc.

* GNU Emacs Lisp packages have already been written to do almost any
  imaginable task.

* GNU Emacs or other Emacs variants are available on far more types of
  computers than vi.  In addition, more and more programs are using
  Emacs-style keybindings.  (This isn't necessarily a good thing, it
  just means spending time in learning default Emacs key bindings can be
  a good investment.)

* GNU Emacs comes on some Unix systems instead of vi.  GNU Emacs will
  come with the next release of BSD Unix.

* GNU Emacs comes with major modes to emulate vi.  (vi can't emulate
  Emacs.)  (See the latest release of VIP or EVI for the best vi
  emulation.)

* GNU Emacs has Shell mode.  You can run shell commands in an Emacs
  buffer, call up previous commands, cut and paste command output,
  review results that have scrolled off the screen, etc.

* GNU Emacs has incremental search.  This minimizes the number of keys you
  need to press to find a string in a buffer.  You can usually find the
  exact occurrence of a 20 character identifier you are looking for in 5
  or 6 keystrokes.  You can also incrementally search for a regular
  expression.

* GNU Emacs has superior, configurable, language sensitive indentation.
  (vi has methods such as ":1,$!cb", which call an external program.)

* GNU Emacs has "query replace".  This is like a global search and
  replace, except Emacs will show you each occurrence in its entire
  context within the file and ask you what to do.  You can even edit the
  occurrence without interrupting the query replace operation.

* GNU Emacs has a spell checker.  (For an even better spell-checker, get
  Ispell and its Emacs Lisp interface.)

* GNU Emacs can "fill" paragraphs, either manually or automatically.  This
  evens up the length of the lines.  It will also right-justify.

* GNU Emacs has a status line for every window showing the file name,
  relative position within the file, if the file is modified, etc.  (The
  contents of the status line are user-configurable.)

* GNU Emacs has support for reading, composing, and sending e-mail and
  news.

* GNU Emacs has rectangular cut and paste --- this works on columns of
  text.

* GNU Emacs recognizes sentences and can cut and paste them.  You can
  change the patterns that are used to find the beginning and end of
  sentences.

* GNU Emacs has Dired, a file directory editor.

* GNU Emacs updates the screen with every keystroke.  (Some versions of vi
  do not update deletes while in insert mode.)

* GNU Emacs will calculate a minimal cost sequence of characters to update
  the screen on slow terminal lines.  In addition, it checks whether input
  is available before redrawing the screen, and if input is available it
  processes it first to avoid unnecessary screen redrawing.

* GNU Emacs prompts for commands that need parameters; thus you don't need
  to memorize syntax.

* GNU Emacs adjusts when a terminal emulator window in which is it running
  is resized.  (Many versions of vi don't.)

* GNU Emacs has real word wrapping.

* If you install Ange-FTP, you can transparently visit files and
  directories accessible via FTP throughout the world as though they were
  on your local filesystem.

There are also some reasons why you might prefer vi:

* vi comes with almost every Unix system, while GNU Emacs doesn't.  (This
  means you'll have to use vi while you're building and installing GNU
  Emacs.)

* vi starts up much faster.  With Emacs, you should keep an Emacs job
  running all the time to avoid this problem.  This can be a problem if
  you don't have job control or a window system, or if you don't read your
  e-mail or news with Emacs and you want to edit messages you're sending.
  (The Emacs process with which I am writing this text has been running
  for 44 days under iScreen, a windowing system for dumb terminals that
  allows login sessions to survive modem disconnections.)

* At the single-user level, you may have to use vi or ed (which shares
  much of vi's command syntax) because the file system containing Emacs
  might not be available.

* vi fanatics claim that setting defaults for Emacs requires more
  knowledge than for vi.  I don't know whether this is true.  However,
  people complaining about this can simply use one of the VI emulators
  that supports vi-style option settings.

* The installed Emacs takes much more file space than vi.

* Emacs has no exact equivalent to vi's "dot" repeat command, because it
  doesn't have the concept of insert mode, and thus can't repeat the last
  action done in insert mode.  However, the vi emulators within Emacs can
  do this.

* Emacs depends heavily on the availability of a Meta key.  Otherwise,
  pressing ESC all the time can be a pain.  This can be avoided by using
  one of the many Emacs Lisp packages that emulate other editors.

* Some people have an irrational dislike for having to press either the
  Control key or the Meta key to invoke commands.  However, they can
  simply run a vi emulator inside Emacs if they prefer vi's keybindings.

* vi has a ":set list" command which will show you non-printable
  characters, even TAB characters.  In Emacs, there is no way to
  distinguish between TAB and SPC characters without moving the cursor
  over them.

* vi uses the tty's cooked mode editing characters in insert mode.  This
  means if you change the keys you use at the shell level, vi
  automatically adjusts.  There is no easy way to do this with Emacs,
  because there is no Emacs Lisp facility to find out what the cooked mode
  editing characters were when Emacs was started.

* vi handles arrow keys that generate ANSI key sequences by default.  (Is
  this true????  Does it read the termcap to find out what the terminal
  uses????)

* vi can display line numbers adjacent to the lines of a file.  This is
  not actually an advantage, because Emacs has many facilities that
  prevent you from ever needing to know the line numbers, and Emacs can
  jump to a specified line number.

-- 
Joe Wells <jbw@cs.bu.edu>
Member of the League for Programming Freedom --- send e-mail for details