EMACS

Friendship ended with Vim. Now I’m trying to make Emacs my best friend.

Vim has been magical to me over the past few years. I had no experience of modal editors prior to venturing into the Vim ecosystem. As it is customary of technology enthusiasts, I went through various phases: novice, plugin-maxxing, vanilla config resurgence. There was just a slight problem, I never took the time to learn Vim in depth. I made the typical mistake of clobbering together a half-assed stockpile of advice from random sources on the Internet, resulting in bad habits that I wasn’t sensitive towards until it was too late. Meaning, by the time I decided that I wanted to get serious about learning Vim, I had so many poor habits ingrained in my mind, that it felt too painful to change them.

I had to admit that modal editing, paired with poor typing habits, was undoing any efficiency that using Vim should have afforded me. When you catch yourself instinctively tracing your right index finger all the way to the letter ‘t’ on your keyboard to type capital ‘T’ because you never paid attention to the SHIFT key on the right side of your keyboard, you’ve lost the plot. When you have a 50/50 change of either saving a file or triggering a macro recording, you have to wonder if you’re on a sure path to trashed fine hand motor skills in a few years if you don’t introduce corrective actions now.

The first thing I did, before diving into Emacs, was taking a detour into the world of touch typing. Now, I’m not an index finger typer. Let’s just say that I had undeveloped pinky and ring finger reflexes in both hands. The best touch typing website that I found is keybr.com. I began spending 5 to 10 minutes every day typing slowly and rewiring my motor skills on the keyboard. As my dexterity improved, I noticed that the amount of errors I was making in Vim while switching modes, performing word operations, and using other complex features of the editor was not diminishing. I could also feel a noticeable mental lag in what I wanted to do and how quickly I could produce the outcome. I suspected that part of it could be attributed to my shallow knowledge of Vim’s internals. So I opened the manual … and failed to grasp most of it.

Vim’s help and documentation is genius in the sense that it’s a collection of interlinked text files. Two things were holding me back, what I experienced as abstruse key combinations to search through the help itself, and the formatting and language in which it is written.

Jump to a subject: Position the cursor on a tag (e.g. bars) and hit CTRL-] is madness to me, given the sheer amount of links on any given help page. Then you have pages that look like the Quickref. Reading through them on the terminal was difficult. You have links, symbols, characters, commands, various syntactical elements with differing semantics depending on context. It’s a lot. The experience of learning Vim always felt frictional. The practice of using Vim had become physically uncomfortable too. I gave Vim and myself a few years, but I don’t think it works for me anymore.

Enter Emacs, yet another complex tool that may require similar or greater commitment to use well. This time around, I have no illusions that I can skirt the boundaries of the knowledge required to use a tool like Emacs. I decided to limit the amount of third party sources that I use to approach Emacs. This is rather easy when everyone online is quick to jump down your throat and berate you for using X wrong, or admonish you to stop doing Y (which they probably advocate for doing in some other clickbaity excretion of theirs). Instead, I’ve been Read(ing) The Fabulous Manual and rethinking my strategy of eating elephants. However, Emacs’ PDF manual is 700 pages long. I don’t have time to read it before I familiarize myself with Emacs. Therefore, I use LLMs (humanity’s latest attempt at destroying the fabric of society) with the limited scope of quickly guiding me through tasks which explanation I haven’t encountered on the manual yet, but I nonetheless need to complete. For example, I may search for shallow answers on how to navigate the file system using Dired to solve an acute need. I will then look up the topic in the manual to get a more comprehensive understanding of what I might have missed.

What I absolutely love so far about Emacs is the approachable and simple prose of its manual and tutorials. The system helps you discover it at your pace. There is a conspicuous absence of overly technical jargon. To use an expression I find particularly amusing, Emacs doesn’t insist upon itself. Early on in the tutorial, it tells you to not worry about mistakenly editing the text in the buffer that you’re reading, which I had just done! As a first time user, the last thing you want to do is to mangle the documentation. It’s the attention to such details that tipped the scale for me. I’m sure I’ll encounter Emac’s cloacas sooner or later but, for now, I feel more intrigued than intimidated.

The practical question to answer at the beginning of learning a complex tool is “Do I need to create a reference for myself?” Creating a cheat sheet feels like the right thing to do, but it’s probably an attempt at bike shedding to avoid doing real work. More dedicated people than me have already created vast references on Emacs. Emacs itself will teach you about Emacs. What business do I have re-inventing this specific wheel? Instead, I believe that the right approach is to get good at perusing the documentation every time that I’m stuck and remembering where I found the information. This page will serve me better as a collection of personal insights as I learn Emacs. You know, the stuff that can’t be found in a manual.

Input Methods

Emacs allows you to input text in a variety of languages. As I recently became interested in learning the basics of an Asian language, I picked Japanese because I’m original, I dipped my toes into the topic of how to type Japanese text in Emacs. The first thing I had to do was to install a font that supports Japanese characters. I went with Noto Sans CJK.

To type Japanese text into Emacs you press the key binding C-x ENTER C-\ which prompts you to choose an input language. You can type japanese (or click TAB to see the available Japanese writing systems) and ENTER to confirm. Once you’ve chosen an input method, you can toggle it on and off by running C-\. Typing the characters that corresponding to the Romaji transcription of the Japanese scripts will produce the characters in Japanese. The vowel a will give you あ, the vowel e will return え, and so on. By clicking SPACE you can toggle between various scripts for the same syllable. To type a visual ASCII space, you must run C-q SPACE. Japanese ideographic spaces can be added with C-x 8 ENTER and searching for IDEOGRAPHIC SPACE.