Why I love vi mode and how it helps me be more productive.

Over the years of working as a software developer and consultant, the languages, frameworks and other tools I am using have changed, but one thing I keep coming back to is vi or vim.

I first started using vi in university some 20 years ago. About 15 years ago now, I had a long phase of using Emacs, but when I changed jobs and started working for Asset Control, this came to an end. As a consultant working for different clients, sometimes only for a few weeks, I did not have the luxury of having all the software at the ready whenever I wanted. The one editor I could generally trust to be available was vi or vim. So, I got used to it again and would quickly choose it over other editors.

When the focus of my work would shift again from scripting languages to Java/Scala and I went back to using IDEs, I would use the default editor mode available.

But one thing always bugged me most: Moving around a file. As many of you will know, vi(m) operates in two modes. Command and Insert mode. While this might be a strange concept for people who are used to editors like Notepad++ etc., the main benefit for me is that you use letters to move around a file (e.g. h, j, k, l move you left, down, up and right respectively). No need for arrow keys!

Without vi, as long as I would use a full sized keyboard, I’d be ok. While the necessary reach is relatively long, you can generally feel the arrow keys quite well. So, that worked ok.

But then another change in work setup meant that I would work solely on my laptop’s keyboard for long stretches. Here, I find it much harder to feel the arrow keys. The perceived uncertainty of hitting the right key or not, together with the disruption of having to move your whole hand made this quite uncomfortable for me to work. Both a physical and mental strain, admittedly low level, but noticeable.

I was still doing a fair amount of scripting in Unix and would do that in vim. Hence I knew how much being able to keep my fingers on the keyboard in a neutral position meant. This is when I decided to bring the vim experience back into my IDE, IntelliJ IDEA via a plugin.

While it is hard to put a number on it, I would estimate that this improved my typing and editing performance by probably around 25-30%. Muscle memory is a super power. Even more so if you don’t have to switch between two systems all the time.

So, not to start a flame war. But if your experience is similar, maybe try using vim mode in places where traditionally you would not expect it. It works very well for me.