published on in Tech
tags: editor emacs

Emacs is a habit

What is Emacs

EMACS may stand for Editing MACroS, but it has some more creative definitions. Here they are.

  • Emacs Makes A Computer Slow
  • Emacs May Annihilate Command Structures
  • Evenings, Mornings, And a Couple of Saturdays
  • Ever Made A Control-key Setup?
  • Elephantine Memory Absolutely Considered Sine que non
  • Emacs Makers Are Crazy Sickos

My road to mutiny

Interactive Mode

I used Vim more than three years before Emacs, so I think I’m very familiar with it.

For Vim users (including me), a small detail is they often restart vim. they open a file, edit it , exit vim; then another, and so on. One reason may be Vim really starts very quickly, but the most important is that Vim lacks interactive mode.

Compared with Emacs’s super-charging completion engine and Ido Mode, Vim is a bullshit in doing things interactively.

Of course, Ido Mode in Emacs is off by default, you can enable it like this:

(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(ido-mode 1)

It’ll enable basic Ido support for files and buffers and the very useful flex matching as well.

Package management

Since Emacs 24 (2012), It (package.el) became part of Emacs. But util now, Vundle is still a plug-in manager for Vim.

What does it mean ? It means Emacs has an official maintained package repository (GNU ELPA Packages) while Vim not. So What Vim missing ? It is Software Reuse.

Ok, You maybe justify that Vim is just an editor not an OS; so package is meaningless for Vim; and Emacs is an OS that a package can be installed in it. For me it is a meaningless excuses.

Either Emacs or Vim, They both have a runtime environment to ensure that plugins or packages run. But on top of Emacs runtime, there is a library layer. Maybe it is the important difference between Emacs and Vim runtime environment.

End result, in Emacs, either a library or plug-in like package, they are treated equally; and a plug-in like package can reuse a library package.

Relative to Vim, I’m more optimistic about Neovim, I hope it can be better than Vim in plugin system, and I donated $15 to it.

Emacs package interface is very good, you can not only use GNU ELPA Packages but also third ones.

(require 'package)

(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)

(when (< emacs-major-version 24)
  ;; For important compatibility libraries like cl-lib
  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))

(package-initialize)