Bruno Arine

Migrating From Vanilla To Doom Emacs

I learned to love Emacs. It’s been the staple of my workflow and it lets me be a more organized person. But the truth is that my init.el, Emacs main configuration file, has become hot mess. Tidying it up would take me more time than learning how to use Doom Emacs, which comes with sweet defaults and a nifty layout, so I decided to bite the bullet.

My intention with this post is to log my journey from pure Emacs to Doom Emacs. I hope this report will be useful to anyone who is willing to make the leap too.

First things first

I didn’t intend to leave both vanilla Emacs and Doom Emacs installed alongside. To prevent Doom from messing up my precious already-messed original init.el, I moved the directory to a safe place.

$ mv ~/.emacs.d ~/.emacs.d.vanilla

Afterwards, it was time to download Doom from github and compile it from source.

$ git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
$ ~/.emacs.d/bin/doom install

And don’t forget to add ~/.emacs.d/bin to your PATH if it ain’t there yet.

$ export PATH=$PATH:~/.emacs.d/bin

First config

The installation was pretty smooth. Now it was time to make sense of the factory configuration. I was impressed by how tidy Doom Emacs devs were with regard to document configuration. Props.

For those of you who haven’t been stained by vi, press i and write away. The first thing I had to do is disable the annoying evil mode. Update: too late, I’m bewitched.

These are the changes I had to do to suit Doom’s config to my taste.

Added packages:

  • evil (heaven on earth)
  • emoji 🙂
  • deft (notational velocity for Emacs)
  • ligatures (ligatures and symbols to make your code pretty again)
  • nav-flash (blink cursor line after big motions)
  • treemacs (a project drawer, like neotree but cooler)
  • unicode (extended unicode support for various languages)
  • multiple-cursors (editing in many places at once)
  • vterm (the best terminal emulation in Emacs)
  • spell (tasing you for misspelling mispelling)
  • grammar (tasing grammar mistake every you make)
  • json (At least it ain’t XML)
  • javascript (all(hope(abandon(ye(who(enter(here)))))))
  • python (beautiful is better than ugly)
  • web (the tubes)

Press ESC exit edit mode and press :w to save your new config. Don’t forget to execute doom sync on your shell and restart Emacs.

Weird bugs I had to deal with

Strangely enough, Doom’s built-in spell corrector wasn’t working from the ground up. It threw a strange message everytime I tried to correct a mistyped word with M-$:

Starting new Ispell process aspell with english dictionary...
cond: Error: ~/.emacs.d/.local/etc/ispell/english.pws: The language "english" is not known. Isto provavelmente é porque: the file "/usr/lib/aspell/english.dat" can not be opened for reading.

I don’t know which is weirder, the fact that Emacs mingled English and Portuguese in the same error message, or that it arbitrarily looked for this non-existent file. Anyways, creating a symbolic link named english.dat and pointing to /usr/lib/aspell/en.dat fixed the problem.