Doing hard things: learning vim

5 min read

Recently, I have made it a priority to learn vim, first starting out with the key bindings and then eventually transitioning to developing in Lunarvim. To be blunt, it sucks — I can feel my stress levels rise as I try to remember how to do something simple like delete a letter. Using it feels unnecessarily complicated, and it is frustrating to have to do things so much slower than I am used to.

This blog isn’t about complaining, rather, what this struggling has taught me and how learning Vim represents so much more than just memorizing specific keys to do specific things.

A recognition of bad habits

I learned to type from quite an early age. While I (somewhat) stick to the homerow, it would be fair to say that I have my own flavour of typing. Sometimes I’ll hit letters just to the right of center with my left hand while simultaneously moving my right hand to the arrow keys. Other times I’ll use shift on the wrong side. Over time these patterns have solidified, and I never really noticed until I went to use the main directional functions in vim. Leaving the homerow is incredibly costly, that’s baked into the design ethos behind the system, and so this has made me have to pay attention each time my hands try to move back into old habits.

Breaking old habits is always hard, and causes us to become uncomfortable. This is good, it teaches us grit and helps us improve in the long run.

Seeds of doubt

As I continued to slog away at doing even the most basic tasks, I began to question if truly mastering something is even worth it in 2023. Technology is changing faster and faster, and wouldn’t it be better to instead try to always be adaptable and master the latest and greatest? What if I configure things exactly how I like them, master the process, only to move to an employer that doesn’t allow me to pick my text editor? I even went so far as to think “what happens if caps lock (the key I have remapped to escape, the one key customization I have done so far) ends up critical for some future process?”. After a few seconds I realized how absurdly unlikely caps lock is to go away sometime soon, but the fact that the thought surfaced in the first place is cause for reflection. Our brains will try to rationalize their way out of things that we do not like. Instead of admitting how hard learning something new is, we trick ourselves into thinking we have a good reason to quit. Long term perspective

I have often heard “oh I just don’t have the time” or “I’m too old for flashy new things”. This process has opened my eyes to the joys of returning to basics. Every day, I type thousands of words and code hundreds (okay, maybe that’s a lie, more like ten’s) of lines of code. Why shouldn’t I take the time to invest in doing that to the best of my ability? And in the process force myself to confront a challenge to make each day feel like progress.

The journey

I plan to start out small, mastering basic cursor movement and common editing methods (deleting, copying, pasting etc). For my editor, I’ve settled on Lunarvim, which many neovim purists may scoff at.

For now, I am starting out by using the vim plugin in vs code. This allows me to ease into things, still relying on some old, while introducing new things one step at a time. After I finish with cursor movement, I plan to move on to git with lunarvim, doing a simple git push as the first milestone.

Later, I’ll move on to solidifying my configuration, but I figure that it would help to first use vim (well) before making any big decisions like that. I have learned with Python installations recently that sometimes simplicity is the best objective, there is something to be said about knowing exactly where all config files live and how to maintain them, and that is something I’ll be keeping top of mind.

For the theme, I have gone with cattppuccin for neovim

Concluding thoughts

On the way home from work today, I ran into my neighbour on the bus. As we were chatting, I mentioned that I had embarked on this new journey, and lo and behold he is a vim user himself! He graciously offered to lend me Learning the vi and Vim Editors, seventh edition [@robbins_learning_2008], which no doubt will be helpful along the way.

If that’s not a sign that this is a step worth taking, I don’t know what is!