#vim

I Switched to Vim


My first introduction to vim was back in university. I learnt the absolute basics, but I didn't really dive any deeper later on. During my years of writing code, I used vim every now and then for small edits, but it was never my main text editor,  probably not even my 2nd or 3rd most used.
It wasn't until this January that I decided to seriously try it out and see for myself if it's worth the hype.

 

Using vimEditing a Python file with vim

What I used prior to it

For writing Python, I'd use Sublime Text for standalone scripts or small changes, and VS Code for working on a project. As of lately, I'd actually use just VS Code for everything. For quickly trying something out, I used the Python REPL, which I still do.
For my work with C# and X++, I'd use Visual Studio (not Code), because of how well it integrates with that ecosystem. Regarding X++, I believe Visual Studio is the only editor where you can build X++ code, so not much of a choice.
I'd use vim mostly for working in a remote server session.


The barrier to entry

Before making the switch, I needed to go beyond the basics. I needed to learn what vim can do, and where it stands out compared to other text editors. Only this way, could I get the answers I was seeking.
And yes, the rumors are true. That learning curve is steep. Vim is a language of its own. There's entire books on how to use vim, which is unusual for a text editor. It's not intuitive by any means, probably because it is so different from anything else that you might have used.

So, be prepared to put in the hours and effort. Be prepared to suffer. It's an investment worth making, as you'll see below.


How I learnt it

I made an oath to myself: during the time I'm trying to level up, I'll use vim for everything. Not just for writing code, whether that be Python, HTML, JSON or config files, but also for writing my personal notes, such as drafts for blog posts. I used vim wherever possible. This really forced me to look things up and keep learning every day, because I needed to get the work done.
Now, the biggest promise of vim is to make you go faster. To speed up text manipulation. And eventually that'll be the case, but at first you will be going slower. It's just something you have to put up with during the learning phase. You'll feel tempted to switch back to your favorite editor during this time, but just stick to vim for a while.
There's plenty of free material online which does a great job at covering vim in detail. This series of articles is a good place to start. I found it most useful to simply look up a specific thing I was trying to do, and dwell into StackOverflow.

 

Is it worth it ?

I mentioned earlier that while vim is hard to learn, it's an investment worth making. But I think that holds up only if you go all the way. At least for its biggest promise, that is speeding up your development workflow. A basic understanding of vim will not make you go faster.
Now, vim is worth learning also for other reasons, such as being available in almost all servers, the ease at which you can export your local settings to another machine etc, so don't run away just because of that. But to make vim a productivity tool, you have to harness its full power. The good thing about it is that the intensive learning only lasts a few weeks I'd say. After that, you'll just be filling gaps every now and then. And you'll be left with a tool which will serve you for the rest of your career, as vim is much more stable than mainstream text editors, which are likely to go through drastic changes or even get discontinued in the future.
You'll absolutely appreciate the comfort and power that vim gives to you.