Two Wrongs

(don't make a right)

On Escape Meta Alt Control Shift

by ~kqr

I've wanted to switch to Emacs for like … a couple years now, maybe.

I tried twice, actually. The first time I quit because the default Emacs keybinds are a massive pain in the ass. The second time I quit because I didn't feel like I had the time or energy to learn Emacs, and all the terminology that comes with it. Minor and major modes? Windows? Packages? Fill columns?

With the very patient help of freenode/#emacs I made the leap a few days ago, and here's a short rant on the state of things.

The Misunderstanding

Whenever people hear I've started using Emacs, they're immediately making jokes about complicated sequences of simultaneous keypresses, like the one I allude to in the title of this post. My fingers must hurt. I must be hoping for a foot pedal as a birthday present. All of that.

I need to set this straight before anything else, since this seems to confuse Vim users: Emacs is actually extensible. This means you're not locked to the default keybinds, which suck. There's a pretty popular extension to Emacs called Evil mode which gives you Vim keybinds for editing text. It works really well.

In fact, the vast majority of my editing tasks – probably as much as 98% – are performed exactly as if I was in Vim. (For the other 2% I've invented my own Vim-style keybinds.) Normally, I don't notice that I'm actually not in Vim. The fact that I happen to be running the Emacs process is a mere technicality.

So … Vim or Emacs?

This is the age-old question, but there are two answers to it.

If I was placed in front of a foreign terminal and I had to do programming to save my life, and someone asked me that question, I'd answer Vim at the drop of a hat. I'm still a Vim user. That hasn't changed. If I'm connected to a server without my configuration, you bet I'll launch Vim rather than Emacs.

But that's not the point.

Most of my editing I do with access to my own configuration. Armed with that, why would I not want the best of both worlds? Of course I'll choose Emacs with Evil mode.

Because you know what? Vim as a platform blows. Vimscript is crippled and weird. The possibilities to extend Vim quickly approach zero if you're not allowed to modify the source code and recompile. The little you can do is quirky and difficult. Most of the functionality is built-in and not changeable.

Emacs, on the other hand, is built on a small, extensible core. Many of its fundamental features are running as regular Lisp functions, which you can override or modify. You can update your configuration on a live process by redefining things and running functions. You can recompile parts of Emacs on the fly. You can change pretty much everything about the editor if you're not comfortable with a default. That's how something like Evil mode is accomplished.

Not to mention that the support for various programming environments is a much better story with Emacs than with Vim, thanks to the proper programming language you use to build extensions and configure and alter the editor. Integration with pretty much any OS function is possible. I'm not saying you'd want to integrate with all of them, but having the option is a huge benefit.

The only noticeable "incompatibility" I've noticed between Emacs and Vim is that Emacs has a significantly slower start-up time. Vim loads instantly, Emacs takes a couple of seconds to load. There are ways to optimise this which I haven't explored yet, but this is generally not a problem because I'll have an Emacs instance running pretty much constantly on any given computer and then do my editing in that.

Other than that, though, Emacs is basically just a more powerful implementation of Vim. I see no reason not to use it.

Do Try This at Home

If you haven't yet, I encourage you to give Emacs+Evil mode a shot. You might discover that you like it. I certainly did, and a lot of other people have.

I do not recommend using Spacemacs. When I first heard of it, it sounded like the greatest thing. When I tried it, I found out that it is built on a bunch of assumptions that aren't necessarily true for every user. What's worse is that some of those assumptions are incompatible with the defaults in Emacs, which means when you need to ask for help about something, the Emacs IRC channel will have no idea how to solve your problem. That's bad, because those people are really nice and knowledgeable. You want their help.

I'm still in the process of learning the more advanced features and configuring my Emacs to my liking, but once I'm done with that I'll probably do a writeup on the process. I don't want to describe something now when it might change later if I find out a better way to do something.

If you enjoyed this article, you might like others tagged with