Playing with Emacs

January 2, 2013 at 11:54 pm
filed under Coding
Tagged , ,

I’m a dyed in the wool Vim user, and I’ve never had time for Emacs. But lately I’ve been playing with it, giving it another chance. Here’s why.

Programmability. I believe in programmable tools because I believe in mastering and customizing frequently used tools. The shell allows you to program your working environment via scripts, functions, aliases, et al. I think an editor should be similarly programmable. As such it’s always bothered me that Vim’s scripting capabilities are as obtuse as they are. Emacs is quite programmable, but more to the point, it’s Lisp.

Clojure. On account of Emacs being, among other things, a Lisp IDE, there are a bunch of well-honed and time-tested tools for editing Lisp. Rainbow delimiters (examples here and here). Paredit is a set of functions designed for manipulating s-expressions. There are a bunch of interactive modes, as well, which facilitate the interactive style of development common to Lisps. Clojure can take advantage of many if not all of these.

Experimentation. Vim takes a modal approach to editing, and commands are combinations of keystrokes. The Emacs paradigm is completely different, as far as I can tell. Nearly every piece of functionality is a function. This has implications for programmability, yes, but it’s also an entirely different way of thinking about your editor.

Initial impressions

So far, it’s clear that Emacs is a completely different beast. I’ve set up package.el where appropriate (Aquamacs for Mac, emacs24 for Linux) and installed a bunch of packages that way.

Keycuts are mostly unknowable to me, and I don’t think I’ll ever master them. Some of them are ridiculously complex. This is the down side of not having a modal interface: modality comes through keycuts, or perhaps more like keychords, frankly. It wasn’t long before I installed evil, a vi emulation mode, for the motions and window/buffer management pieces alone.

Configuring stuff like fonts and whatnot seems complex to me; Emacs has its own model for the appearance of text (“faces”). Actually, in general, Emacs has its own model and paradigm for various pieces. That’s not a value judgment, as that’s true of Vim in other areas, as well. But it is a substantial adjustment.

I haven’t figured out a good project-style mode akin to Sublime Text’s that doesn’t require a bunch of setup beyond picking a few directories. Vim falls down here, too, for what it’s worth.

I will say that configuring it, as expected, is a lot easier. And it’s almost fun.

Long-term, I don’t know how much I’ll stick with it for anything other than Clojure development. But it’s fun to explore another paradigm and as I become more fluent with it I’ll get to see the real differences.

%d bloggers like this: