Escapes

Writing is my best escape from analysis paralysis.

Dilemma of the switch to Vim

Okay, so you find everyone around you talking about their sky-high productivity since their switch to Vim, showing-off their cool configurations and doing just about everything without getting their hands off the keyboard.
You’re tempted, but can’t even think of parting ways with your beloved IDE?

(You can also read this on Medium)

Neovim

. . .

I’m assuming those of you who made it here have at least a little idea what Vim is. If not, it’s a text editor. Yes, that’s all it is.
Then why is it such a hype?
If you’re not already aware of the stark dilemma of “To Vim or not to Vim”, I highly recommend you to delve into it. No prizes for guessing that I too was a victim of this popular dilemma and by the time you’re done reading this, you’ll know how I faced it and what factors shaped my decision. Hopefully you can relate to some of them. Just to clarify, this is not going to be an answer to “Should I use Vim?”, but an encapsulation of the experience almost every Vimmer must have gone through before taking the tough decision of bidding adieu to their old IDE and changing the way they write code forever.

If you’ve gone through that phase, this might be a nostalgia trip for you. If you ever plan to do it in future, this might hint you of what to expect. If you’re currently at that crossroad, this is for you!

. . .

Preconceptions

Default Vim startup window

Default Vim startup window

“How can they even think about coding in that dull terminal?” used to be the very first thought striking my head on hearing the word Vim. Although it did fascinate me how it was even possible, but not to an extent to try my hands on such a tasteless thing.
There were continuous heated discussions around me about which text editor to use for coding, and I pretty much never paid heed to them, satisfied with my current IDE, Atom. I couldn’t just ditch my fancy go-to editor that I’d been using for over an year now, for some ancient looking piece of software. I was accustomed to my old IDE, had learned some quick shortcuts and it was close to my heart. Sometimes it was as if my eyes would reject code if they weren’t seeing it in my own editor. All I knew was that you have to learn a different keybinding (basically a keyboard key/set of keys to press) for every action you perform in Vim, and the mouse is a no-go. This made me think of things that seemed impossible without a mouse, which made me doubt it further.

What difference does an editor make after all. All you have to do is write, edit and run code, and Vim was the boomer of editors in my head.

. . .

The dilemma grows

It was high time. Every now and then, there was a new outburst of an editor-centered discussion, with the Vimmers disregarding every other editor outright. All of them would temptingly appraise their quick movements on the keyboard, their ever increasing speed of work and rocketing productivity. I tried to dismiss all that by telling myself they’re exaggerating.
But the seed was sown. It made me think. Maybe there is something special that I’m missing out on. The other voice in my head replied, you’re too comfortable with your current editor so there’s no point switching.

With the curiosity soaring as to why this thing is considered the holy grail of productivity, I read other people’s stories on the internet in hopes to find someone who thought otherwise. But to be honest, there was not a single soul I could find who regretted their switch to Vim (or maybe I didn’t look hard enough).
Okay, if no one regrets it, I too won’t. With this in mind, my computer soon had Neovim (which is just traditional Vim, with some improvements) installed. There’s this inbuilt VimTutor that comes with it and I decided to just try and learn a few keybindings and judge for myself. I’ll not stop using Atom, it’s just a try, I told myself. Within a day, I dreaded Vim’s clumsy shortcuts and decided to scrap the idea.

But things didn’t pan out as expected. Many times while typing elsewhere, and not just code, even writing documents, I would find myself subconsciously recalling how much easier it would have been, had it been possible to use that particular keybinding here, or maybe another one over here. As I remember, the most notable of them was to just press ‘dd’ to delete an entire line.
Since supposedly all the magic was in the keybindings, a friend of mine suggested to add a Vim plugin to Atom or a different, better looking editor and it’ll be a win-win situation. Moreover, I never wanted to dreadfully sit and configure my entire Neovim from scratch. This was my worst fear. It’s going to be too complex for me. I forged around for new editors and eventually having my issues with all, reverted back to Atom with a vim-mode plugin. Atom’s vim-mode however, was not satisfactory by any means and I wasn’t pleased.

Something had to be done.

. . .

Decision time

Majority of the successful (it’s a relative term, but successful from my perspective) and inspiring coders around me were Vimmers. I began associating their success to using Vim and if I don’t, I’ll fall behind (I know it sounds silly, but that’s exactly how I used to think). Though it seemed a vague idea, I was sold.

My quest began by looking for pre-written configurations for Neovim, since no way was I going to take the pains of doing this very very hard task on my own from scratch. I tried a few configurations like SpaceVim. No doubt they were super cool, really good-looking and classy, but very tedious to customize, and unfortunately I was too picky for detail. So I looked for other people’s dotfiles (which are configuration files that other people use and share) to copy them straight away and save myself the work. Deep down I wanted to make my own, but there were too many doubts and fears pushing me away. Somehow I would find faults in them too and desired a more personalized experience, free from even the minutest flaws. It was a conflict between perfection and self-doubt.
At this point, my fickle-mindedness kicked in yet again. No way can I do it on my own from scratch. I’ll just settle with Atom’s vim-mode.
I did switch back to Atom for a few days but the ‘successful’ people argument and cravings for high productivity were shining too bright in my mind to shield. There was no way back.

. . .

The Switch

Being left with no option and pushed to the corner, it was time to do the thing I feared from the day I heard about Vim. The thing I was trying to avoid at any cost from day one seemed inevitable now. Configure from scratch. With much hesitation, it was time to leave my comfort zone. It was time for the Vim switch.

A couple of days later I finally grabbed the courage to pick up a reference configuration file and began adding and deleting stuff from it, learning about its technicalities in the process. Suddenly I felt ashamed for holding myself back from doing this much earlier. Clearly, I had overestimated the task and created a false mammoth perception of it.

It was much more fascinating than I had anticipated. Much more fun than I imagined. The bland, tasteless editor slowly started turning into a full fledged IDE with the addition of each new line to the the configuration file. Each new line of Vim script added was an adventure in itself (I’m not going into details of configuration, because there’s ample of it around).
Finally aware of what I was doing, I couldn’t stop tweaking with it for days! When the visuals and other stuff were done, it was time to roll.

My Neovim configuration

My Neovim configuration

The geeky keybindings seemed overwhelming in the beginning, but it’s just a matter of time once you get used to it and register them in your muscle memory. There are plenty of articles/tutorials out there to help you get accustomed to the keybindings and they actually help.
Initially, the rise in productivity seemed a big hoax. But gradually it all started to come together and my speed was noticeably faster than on any other editor. I soon realized that it was not all about the keybindings. The commands that Vim offers are a boon. The things I couldn’t think of doing without a mouse were all handled by mere key-presses, which makes it much easier to keep your hands on the keyboard, rather than making back and forth trips between the mouse and keyboard. And so it was done, I was the newest addition to the Vim club!

. . .

The bigger picture

This little ‘journey’ was not just limited to the confines of productivity. It brought along a number of experiences and lessons in disguise. It might be true that I made this decision out of peer-pressure, but today I’m glad that I was pushed to the corner and faced it in my own way. Fortunately, it is not something that I regret even a bit. I did feel bad for leaving my beloved old editor, but a change for the better is never a bad idea. Modifying the Vim script file was like learning a whole new language in itself. Every now and then I find myself playing around with the configuration file. I turned a boring looking editor into a fully functioning IDE and guess what, I got to keep the color scheme from my previous editor! It was one of the most satisfying feelings and I feel proud to have achieved it.

It is important to overcome your fear and not run away from learning new things in this field. I overcame my self-doubt and realized that underestimating yourself without giving something a shot is the worst injustice you can self-inflict.
Finally I’d just like to sum up by saying that it was well worth the time and effort, and the learning curve associated with Vim is a bit exaggerated. On the flip side, the experience of facing the Dilemma of the switch to Vim is indeed underrated!