Vim Mode Everywhere!

a person typing on a keyboard
Photo by Florenz Mendoza on Pexels.com

Tools tend to be standardized. There are screwdrivers made for specific types of screws. There are pencils whose lead (or graphite) has a standard darkness or hardness. Computers have standardized ports for plug-in in devices, and communication tools have standardized protocols to allow for effective messaging between points. And yet, as I have written before, there is little or no standardization of keyboard mappings between systems and applications.

Beyond some basic commands (CTRL-C/CTRL-V for cut and paste for instance), the keyboard commands of one application frequently differ from that of another. It means that if I am using Microsoft Word, I have to remember an entirely different way of navigating a document than if I am using another tool. At my age, it is far easier for me to remember one set of keyboard commands and apply them everywhere.

To this end, I have recently switched to using Vim mode wherever it is available. For those unfamiliar with the name, Vim is a modal text editor that has been around for a long time in the Unix world. In the word processing world, its closest analog may be WordStar.

The most frequent apps that I use are Obsidian (for all of my notes and writing and journaling and just about anything paperless); Visual Studio Code for the vast majority of my coding; and Vim itself for editing miscellaneous text files. I have played around with Vim mode before, especially in Obsidian. I wasn’t entirely successful in that initial attempt for a few reasons:

  1. The system in Obsidian hadn’t reached a level of maturity that made it worthwhile.
  2. Other tools still used other mappings that I had to remember.

But over the last month or two, Obsidian has improved its Vim functionality to the point where it is mature enough for practical use. Moreover, I discovered that Visual Studio Code has a Vim mode plug-in. The combination of Vim keyboard mappings in these two apps meant that about 90 percent of what I type could be done using Vim mode and Vim keyboard mappings. Of the remaining 10 percent, I figured that 7-8 percent could be handled by using Vim as my default text editor (MacVim and the native Vim supplied in terminal). With Vim mode and keyboard mappings available for 98% of what I typed, I finally felt it was worth making the move.

I did so, as my Obsidian daily notes remind me, on March 11. I switched to Vim mode in Obsidian, as well as in Visual Studio Code. I also configured MacVim as my default text editor (I was already using Vim in terminal to edit text files).

I did something else that day. I decided I needed to force myself to learn Vim’s “language” for keyboard commands well, and then best way to do that was immersively. As I set to work, I pushed my track pad off to the side, so that I wouldn’t be tempted to reach for it to move the cursor around, or to highlight text. I would force myself to learn how to do it properly in Vim, with the keyboard only.

More than a month into this experiment, I am extremely pleased with how well it is working out. At first, I was much slower at performing certain tasks (particularly moving text around) than I was with the trackpad. I think this is the hump that stymied me in previous attempts. I stuck with it, however, and eventually I crested that hill and things began to get much easier. Since then, I’ve started to expand the tools available in Vim mode, both in Obsidian as well as Visual Studio Code. After a while, I noticed that I was starting to think in the pseudo-language that is Vim keyboard commands. That made things easier for me.

Perhaps the best part is that I can use the same commands and keystrokes in nearly every app I work in throughout the day. The exceptions, are usually apps where typing and manipulating text don’t apply.

I’ve taken this a step further. I try to do all of my writing, for instance, in Obsidian, no matter what that writing is. I have written, for instance, about how I use Obsidian for my professional writing. I have written about how I use it for my blog writing; I have also written about how I use Obsidian for journaling. All of this further reinforces my skills at Vim keyboarding, and as they improve, I am able to do things faster and faster.

Now, I am also using Vimium, a Chrome extension that lets me navigate in my web browser with the same keyboard commands I use in Vim.

Vim is not for everyone. It is a modal form of keyboard entry, and that might be cumbersome for some people. Then, too, not everyone needs the speed I do to get their work done. There is a definite learning curve to it that I needed to stick with for several weeks before it started to feel natural for me. Having made the leap, and having gained that vital few weeks of experience, I can’t see going to back.

It is also nice, of course, to only have to know a single set of commands no matter what application I am using. My aging brain and muscle memory appreciate that.

Written on April 3, 2022.

Did you enjoy this post?
If so, consider subscribing to the blog using the form below or clicking on the button below to follow the blog. And consider telling a friend about it. Already a reader or subscriber to the blog? Thanks for reading!

Follow Jamie Todd Rubin on WordPress.com

Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.