Why I started learning Emacs in 2016
Why learn another editor in the first place?
The main role of a good editor is to not get into your way while working, and maybe even help a bit from time to time. If you are a programmer, chances are you are spending a large amount of time using one â and thatâs why itâs so important to choose a good editor. Learning a new editor is always a big investment â significant time passes before you tame your chosen tool and adjust it to your needs.
Iâm a long-time IntelliJ Idea user. And itâs great for Scala/Java development, probably the best in market. But then, in some ways it feels a bit heavy. Even for the tiniest experiment you have to create a âprojectâ, with its own window, meta-data directory etc. You go through a short wizard, and then it has to be imported and indexed, and re-imported, re-indexed, âĶ. Maybe it doesnât sound like much â but itâs definitely not a âlightweightâ experience.
And then there are all those cases where you just want to edit a file. Maybe itâs a simple HTML page, or a blog in markdown. Or maybe you want to quickly clone a repository from GitHub and just browse around without bothering with the whole importing process. Thatâs why you need another editor in addition to a full-blown IDE such as IntelliJ.
For many years Iâve used either Vim or Sublime, but I never really learned either well, I know only the basic shortcuts. But I decided that itâs about time to get to know at least one âregularâ editor better. Choosing between Sublime, Atom, Vim and Emacs I decided to go with the last one. Why? Well, Iâve heard of all those legendary hackers using them, so even though Iâm very far from being a legendary hacker, I wanted to join them at least on the editor lever. Secondly, Emacs seems to be gaining popularity among programming hipsters â again a good reason to try. Finally, itâs been around for so long, and itâs still being developed, also for new languages (see Ensime), that there must be something in it.
Results
As always, there are good and bad sides. After 3 months of the experiment, mostly spent configuring Emacs, trying different modes and learning elisp, Iâm not yet sure which side wins. Iâll skip the rant on the completely different keybindings from everything else, as thatâs just a characteristic of the tool. Considering Emacsâs age, you might think that all the other tools should use C-w for cut, not the other way round (Iâm currently using IntelliJ for Scala and Emcas for everything else. Iâm training my brain to be elastic enough to know when to use which keymap).
On the good side, itâs definitely great to have a homogenous editing experience whether Iâm experimenting in PureScript, writing a blog in Markdown, browsing through a simple Scala project or making a quick CSS fix. Magit is great for git â if only thereâs a .git in some parent directory, I can commit, branch, push using the same friendly (!) interface. Without creating any explicit projects, projectile has good heuristics on when a directory is part of a project and whereâs the project root, allowing me to navigate to other files in the project (again, thatâs usually demarcated by where the .git directory is) without any additional steps.
On both the mixed good&bad side, you have to configure everything yourself. Not surprisingly, itâs the same experience as with Linux. When I was young and smart I enjoyed spending long days recompiling everything from source using esoteric compiler settings I found on the Gentoo forums, and then spending some more days trying to get my sound card to work. But now Iâm a happy MacOS user, happy as I donât have to deal with those things. So with the Emacs experience of âconfigure everythingâ I feel a bit younger, but then I imagine I might want an editor which âjust worksâ at some point.
On the definitely bad side, the quality of the different modes/packages (plugins) varies. They often offer inconsistent keybindings, which causes you to either re-define the keymaps in the configuration, or memorize different keybindings depending on which language you are currently in. For example, when editing Markdown the key combination I use for moving between words is assigned to changing the header size. Another thing is auto-indentation. In some languages it works great. In others, it often gets lost. Iâm sure of course I could fix all of these flaws myself, by overwriting some elisp functions using the advice mechanism, for example. But then I donât want to become a full-time Emacs configurator.
In the future âĶ
Who knows, you might see me doing a live-coding presentation from Emacs one day. Or not ;).
Or maybe Jetbrains will develop an all-purpose editor basing on the excellent foundation they have in IntelliJ? Without the need to create projects, allowing me to just browse to a directory and edit files there. That would definitely be a very strong contestant in the editor wars.
| Reference: | Why I started learning Emacs in 2016 from our JCG partner Adam Warski at the Blog of Adam Warski blog. |


