Starting Vim Journey

19 Aug 2023·5 min read·🇬🇧

What’s up! I am joining Vim club, my friend!

How I start

I started a real journey with Vim at 13 Aug 2023 because of ThePrimeagen who recommended at least to use Vim motion/keybinding. I heard so many times and have tried Vim before, but turns out it makes me slower 1/100000x. It feels very bad then I chose to stop and back to normal keybinding.

Until I saw ThePrimeagen’s videos sharing why he use Vim and his react about his friends who left Nvim. With those videos I understand Vim would slow your workflow at the first time but it would going crazy if you had master it. He mentioned that if you will write a code for many years, which is me, it could save you so much time. It’s actually general for me as I knew what’s the point of using Vim, but seeing he not denying for his friends who left NVim is a sign he is not glorifying without a reason.

Not forget to mention vidner who recommend ThePrimeagen and the edgiest person I know.

Realize My Mistake

ThePrimeagen is not only share about his experience but he also teach us from where to get started and giving caveat before using it. His videos is realizing my mistake at first time I tried Vim, which I tried to make every move must be the right & efficient move. Thus, I always to think how is the right move to achieve something. However he told to start with mastering basic move until you will realize is not enough and expand your move.

Basic Move

Here’s just a basic move that you must understand. First is you must know that you can exit Vim with Esc and :q or :qa!🤭. Then you can get started to understand basic mode that Vim has.

  • Normal mode is mode that you can navigate with your keyboard.
  • Insert mode is only the mode that you can insert a text. To enter this mode you can use a or i in normal mode.
  • Visual mode is mode that you able to block a text, you can enter this mode with v (visual mode) or V (visual line mode).

After you know the basic mode, you can move on to learn how to navigate in normal mode. Here’s few key that you should to know:

  • j : move down
  • k : move up
  • h : move left
  • l : move right
  • b : move to previous word
  • w : move to next word

Then you should know several key binding to edit the code:

  • d : delete
  • dd : delete line
  • y : yanking (copy)
  • x : cut
  • p : paste

I have not remembered those keys in my first week (when I wrote this document), so don’t worry if you have not a good progress like me.

Other basic move that you should know is you can multiply your command with a number. For example:

  • 10j : move down 10x times
  • 10dd: delete 10 lines

That’s I think can make Vim faster than others.

Train Muscle Memory

Navigating is a key to make your move very fast. Moving fast can’t rely with your brain, it must trained as like you know where the position of each keys in your keyboard. You’re not thinking where position A, B, C, D, E in your keyboard because it was trained and remembered in your muscle memory.

Vim AdventureVim Adventure

I train myself with Vim Adventure games in their website. Unfortunately it is not free for Level 3+, but it’s enough to train basic move j, k, h, and l.

Forcing My Self

I will mastering Vim if would not use it. Thus, I forced my self to use it in my workflow. ThePrimeagen is using NeoVim as his workflow, but it is too far for me. I cannot live with a lot of VSCode extension. I know my friend was using Vim in his VSCode, then I found out there is an extension to use Vim keybinding in VSCode.

Then I install Vimium in my browser thus I can full navigate my browser with my keyboard like I used Vim. That’s very convenient for me.

First Week Problem

When I wrote this blog, it is exactly one week after I started using Vim. At this moment I went slower than usual. I still mix them with mouse especially when I need write a code faster than usual. However I still keep the Vim in my workflow, I even used Vim in the terminal instead use Nano.

I also noticed a lot thing missing while using VIM in a first week, which are:

  • I can’t use yanking clipboard
  • I can’t use multicursor

I already solved those problems, but I still slower than usual. This week is hardest week because I felt bad to not write code faster as usual even I know I could make it. Forcing myself slower to get new skill is scarification for me.



Youtube Top CommentYoutube Top Comment

Lastly, this is greatest feature and reason I decided to use Vim. It’s because I declare my self as unordinary engineer in my office. Beside that, I also believed this would boost my productivity and I will continute the journey. Let’s join our club my boys!