May 31, 2018

Why you should invest in an editor

Emacs 26.1 was released this week and I thought I’d use the occasion to write a quick post about the main reason why I stick to Emacs: consistency. Happily, I realized that this reason applies to other text editors as well.

I use Emacs for programming; whether it’s Rust, C, Erlang, Python, or bash scripts, Emacs is the editor I choose. For any language I use, I have syntax highlighting and automatic indentation, and depending on the major mode, I can get other cool features such as jump-to-def, auto-completion, or REPL integration.

I use Emacs for writing; for my blog posts in markdown, for my work journal in org-mode, and for my LaTeX documents, Emacs is the tool I reach for. The usual actions of spell checking a word, formatting a paragraph, jumping from one sentence to the next all work the same no matter the kind of content.

I also use Emacs for other tasks: I use magit to manage my git repos, I use elfeed to follow RSS feeds, I use twittering-mode to read Twitter. I can use usual text tools such as searching by regex or M-x occur if I’m looking for something in particular. The tool doesn’t have to provide the functionality, I get it for free from my editor.

When I’m asked why I don’t pick specialized tools, my answer is that I enjoy having a consistent experience, no matter the kind of work I’m doing. Emacs gives me that. My fingers can perform tasks before I’ve had time to think about them. When I used to switch between Emacs and Eclipse (which I used for Java programming), it would take me a few minutes to readjust when I switched from one tool to the other. Instead, I prefer to use a single tool and not deal with the difficulties of constant context switching.

I use Emacs, but if you use Vim, Sublime, Visual Studio Code, or any other editor, you can probably relate. How fun is it to use Vim text objects in code and in config files, how enjoyable is it to have access to Sublime’s multi-cursors in your master’s thesis as well as in the code of your personal web page? There is great value in taking the time to learn and master your text editor and using it for as much work as is reasonable. (Don’t be a zealot though: if another tool is clearly better, use it. Emacs is a terrible web browser, use Firefox or Chrome instead.)