Skip to content

Here is the reason why I love Vim text editor

Published: at 03:52 AM

For the past 2 years, I have been using Vim as my primary text editor. In this article, I explain why and how I started using Vim and my journey with Vim.

The beginning

It all started in July, as I was learning React and other stuff. At that time, I used Visual studio code as my primary editor. And the Laptop I had was not that powerful to write code faster. Whenever I’m coding or try to edit a piece of code or to move around inside a file is a bit hard as I found myself using a mouse all the time, I don’t want to do that.

The Hunger

So I looked at the keyboard navigation and other shortcuts in Visual studio code. But that wasn’t enough to satisfy my hunger for faster navigation inside the file and quick edits and quick response text editor. So I started to search for solutions to solve these problems.

Encounter

After a week or so, while scrolling videos on Youtube, I found a video of Vim or to be very precious Youtube recommendation algorithm suggested a video of Vim. I cannot remember the exact video I saw, but I know the channel name ThePrimeagen. In that video, he made the navigation and editing of a file in Vim very cool. So I started to watch more of his video on Vim. And I fell in love with the editing and navigation speed in Vim. In the end, I finally found what I needed.

Try-out

I started with installing the GUI version of Vim in Windows. Launched the GUI Vim and tried to edit some files. The UI is not pleasing to the eye, with no file structure tree for navigating between files. And on top of that, I don’t know any of the default keyboard shortcuts. It felt like a nightmare to Vim as a text editor. So I dropped the idea of using Vim as a text editor.

After a few days, I again got to see the power of Vim from the same Youtube channel and wanted to try it out once again. This time I installed the terminal version of Vim. After using it for a minute or so, the plain-looking UI and missing file navigation stopped me from using Vim again. Then I watched a lot and lots of Youtube videos for learning keyboard shortcuts and how to customize Vim.

Unlike other text editors, you can customize Vim to the core as per your liking and your taste. That is also a selling point for me to use Vim other than the keyboard navigation.

Learning curve

The only reason I choose Vim is that I can edit and navigate between files faster and without using a mouse. For that, I have to learn all the new keyboard shortcuts and all the combinations of actions that Vim provides. To begin with, I don’t even know how to exit from Vim. It felt like I have to climb a huge mountain to learn and make some of the navigation shortcuts and editing shortcuts a natural habit.

I started with hjkl. ‘h’ is used to move the cursor to one letter to the left and so on. But it took some time to become a natural habit. During the practice session, my hand was unconscious trying to use arrow keys for navigation. Then, I realized it is not an easy task to make these new keyboard shortcuts a natural habit. So kept on practicing.

Resolve

It is not an easy task to learn new keyboard shortcuts and commands that are in Vim. At first learning, Vim seems hard, but trust me, it’s all worth it in the end. All the hard work and coding using Vim do not pay off immediately. But, in the long run, once you learned the basic keyboard shortcuts and once it became a natural habit, then you will know the worth of it. One cannot master and be good at one thing in a single day. So we need to keep on practicing every day. Take one step at a time and move forward. Eventually, one day you’ll reach a point where using Vim shortcuts became a natural habit and enjoying yourself when editing and navigating inside a file.

Action

After some time, I stopped and can’t move forward and don’t know where to go from there. So I planned to learn most of the keyboard shortcuts as much as possible. So I started hunting for Vim keyboard shortcuts videos and starting practicing Vim commands and shortcuts one by one till it became a natural habit.

Soon after that, I got familiar with most of the basic keyboard shortcuts. So I started to use Vim as my primary text editor. Even after learning and practicing keyboard shortcuts, It differed when coding in projects.

At first, I didn’t practice all the newly learned shortcuts at once. If you overload your mind with different shortcuts or things at once, you’ll find it hard to handle it. Moreover, you’ll hate it or even forgot it after a few days that you practiced those shortcuts. So take your time in practicing each new shortcut. Just practice one new Shortcut every day and move to the next one once you get familiar with the old one.

What I learned

  1. I have been using Vim as my primary text editor as a web developer for the past six months. These are the things that I learned during this period.
  2. It is so much fun to navigate inside a file without moving the hand from keyboard to mouse.
  3. Editing the file is so much easier.
  4. Vim, Visual studio code, and so on are just text editors. There is no perfect text editor. All the text editors are good in their ways. Just choose the one that is bests for you and as per your need.
  5. I find myself I was navigating and editing files faster than before.
  6. We can use Macro in Vim If we want to repeat something in a particular pattern. And I found myself using it more often.
  7. Vim is just fast.