Spacemacs: The Final Frontier for a Diehard Vim Fan
Learning to love Emacs tooling without giving up Vim
Space Silhouette by Greg Rakozy is licensed under Creative Commons Zero
While I love Vim dearly, I’ve always been curious about Emacs. I had used it for a bit while pairing on Rails development with an Emacs user a long time ago. It didn’t go smoothly, but that experience gave me a taste for its plugin ecosystem. One such plugin is company-mode which is great for code completion. You can get behavior like that in Vim, but it usually takes some finagling. I’ve always wished Vim had a built-in plugin manager like ELPA (this being a time before the several good Vim package managers were available) so that I didn’t have to do much manipulating.
Emacs has never clicked with me, for a few reasons. First, and foremost, it lacks the powerful cursor movement keybindings my muscles have memorized. After spending so much time mastering the unintuitive VimScript language, I didn’t want to have to learn LISP just to configure my editor. Even when I was able to configure it (by naively pasting code I found by Googling), I could never remember what Ctrl+ key combination I had to press to make the plugins work. Luckily, Spacemacs solves these problems for me.
Spacemacs uses Evil to emulate the comfortable tools like the h, j, k and, l movement keys, modal editing, visual selection, search/replace, and many others. It’s incredibly simple for a Vim user to start editing text in Spacemacs.
Configuration is simple with Spacemacs. It’s different than standard Emacs, in that it uses layers to change its behavior. Think of a layer as a modular, opinionated, git-managed set of plugins and configurations for a specific type of work. For example, the Ruby layer configures version manager (rbenv, rvm, or chruby) settings, includes a test runner, RuboCop linting, and an in-editor REPL right out of the box. You only have to add
ruby to the list of enabled layers in your
~/.spacemacs file and source it. Emacs takes care of installing any packages that the layer depends on.
Best of all, I don’t have to search very far to remember how to use these plugins that the layer introduced. Spacemacs uses a leader key to show a drill-down menu of command options. Using the Ruby example from earlier, when I press Space I see a list of things I can do in a Ruby project, like run a rake task, or execute a test. I can also execute a fuzzy search for a command if I don’t remember what the drill-down key sequence is (similar to the CMD + Shift + P command search menu in Sublime Text and Atom). In addition, the layers are well-documented and include cheat sheets for command shortcuts.
So, are you a Vim user curious about Emacs like me? Or even an Emacs user curious about Vim? Spacemacs will give you a comfortable safe space that can minimize panicked flailing around. It might even make you productive, all the while helping you to find some empathy for those on the other side of the editor Holy War.