The God of Text Editors - Vim
Erhua Li / 2023-08-08
Categories: tech / Tags: vim, emacs / Word Count: 751
Today is the beginning of autumn, haha (my cute little cat) was very intimate with me tonight, liking to lick my face and neck. I have light sleep, so I got up and wrote this at the dining table downstairs (2023-08-08 02:15:00).
On August 6th, I posted my first moment of the year, commemorating the passing of Vim’s father Bram Moolenaar. For me, Vim is no longer just a text editor, but a philosophy, a workflow.
There are only three types of programmers in the world: those who use Vim, those who use Emacs, and those who use something else. I am the first type.
I have completely lost the ability to write code after leaving Vim mode. Vim’s philosophy has been deeply carved into my workflow. This text is also written in Vim mode in VS Code.
To make it more comfortable, I used Karabiner to map the Caps Lock key next to the A key to Esc when pressed alone, and Ctrl when pressed with other keys.
The Caps Lock key is now the most worn key on my keyboard, because Esc and Ctrl are very important modifier keys in Vim’s workflow.
Now most IDEs support Vim mode. The first plugin I install for JetBrains tools is Vim (no doubt about it). The first feature I look for when choosing a note-taking tool is whether it supports Vim. I’ve introduced the note-taking tools I’ve used before, from Quiver’s unmatched excellence, to now Quiver and Obsidian together carrying the burden of my notes, because their great Vim support led me to finally choose them as note-taking tools.
I still remember the first time I came in contact with Vim. It was my first job mentor Dan Dan. I saw him dancing like writing code in PyCharm. He could quickly delete words, delete lines, and even select a paragraph without the keyboard and then quickly and accurately perform various replacements on things inside. I was attracted by this thing.
Practice makes perfect.
At the beginning, I forced myself not to switch back to normal mode, just writing code in Vim mode, because I knew that only in the specific usage environment could I grasp it more quickly until I was very proficient.
At the beginning, I found that the efficiency of writing code dropped sharply. But I didn’t have the idea of switching back to normal mode for a moment, even during the process of debugging bugs and preparing to go online. So from the beginning, where every feature had to be looked up in the documentation and writing code became very slow, to later, after about half a month, I was already very proficient with the basics. At this point I could feel that the speed of editing code had increased a lot. Especially when rewriting a section of code, it was really convenient and quick to do it with Vim. Since then, Vim has become an indispensable tool for me to write code, so much so that now I can only work quickly and efficiently on my own configured computer, because only on a computer that I have configured various different keyboard mappings can I exert my maximum power of Vim.
With the basic Vim operations, I could handle most scenarios. But I wanted to understand this tool more deeply. So during that year’s Spring Festival holiday, I studied the chapter by chapter of what I think is the best Vim book I’ve ever read, “Practical Vim”. Then I found that my Vim skills had improved greatly. Many of Vim’s workflows and philosophies given in it still have a profound impact on me. So this book is often in the first place in my iBook, because I often refer to it. So far, it still provides me with many text editing solutions.
I also tried using pure Vim to handle project code and Spacemacs (Vim-style Emacs - sitting on the fence between Vim and Emacs) for development. I found that with various plugins, it was already on par with paid IDEs in many ways. Later, feeling that IDEs had more advantages in code review, I switched back to using Vim plugins in IDEs. But the joy of tinkering with tools also allowed me to experience a lot of different happiness, a bit like tinkering with many toys when I was little.
Thanks to Bram Moolenaar for bringing us Vim, the god of text editors, allowing me to write code more happily and recklessly. R.I.P.
Written at 2023-08-08 03:11:00 536A.