Friday, October 21, 2016

Vim Katas

It was about 5 years ago when I watched Jim Weirich solving the Roman Numeral kata at an SCNA conference in Chicago. I was amazed by how he mastered his editor of choice: Emacs. His fingers were flying on the keyboard and he wrangled the code I have rarely seen anybody before that.


I started using Vim in 2008 or 2009, but I never really invested the time to be good at it. I read the man pages, I went through Vim tutor, but I never really picked up or started using most of the advanced features.

I remember how great I felt when I reset my Caps Lock key to function as Ctrl key. The power of hitting <Ctrl+c> with my pinky and index finger just to trigger <Esc> without reaching up to the top left on the keyboard made me feel I've just found kryptonite.

I've had the book Practical Vim for some time, but I never really practiced the examples in it. I looked at them here and there, tried them out, but I've never made a habit of practicing those daily. Then one day I got sick and tired of my inabilities, I started a new markdown document where I jotted down the first exercise and the project of Vim Katas was born. Every time I commuted to work, I started with the first one and practiced all of them. Once I got to the end of it, I read the book further and added new exercises to it.

I might have covered 60% of the book by now, but when I bump into a repeatable task and I leverage a macro for it, it always puts a smile on my face.

Using Vim reminds me of learning to play a musical instrument. It takes time and effort to be good at it, and the keystrokes have to be at your fingertips. Once you slow down and think about it, the effectiveness of the text-based editor fades away, you would be more efficient by using visual editor instead (like Sublime Text, IntelliJ or Visual Studio).

Vim (and I am sure many other tools) has this huge wall that people have to climb first to appreciate it. Clone that repo, open the first markdown file in Vim, and start practicing!