DEV Community

Cover image for On Learning Vim
Sindbad
Sindbad

Posted on

On Learning Vim

A year ago (I still do), I would get so amazed and overwhelmed watching ThePrimeagen navigate the Vim editor. I wanted to do it as well. But I was too afraid to try it out and thought I wasn’t that smart, and it was too much work to learn something that wasn’t directly adding any value to my programming knowledge. But at the same time, I wasn’t happy with my current VS Code experience, which kept crashing on my machine since I switched to Linux from Windows 11. A few months ago, I said, eff that to my fear. At least I’ll try and see what is this crap that allows Prime’s cursor to move with lightning speed.

Jumping straight into Vim felt notoriously dangerous, so I installed the Vim emulator extension in VS Code.The first two weeks were frustrating and negatively affected the task I was working on. So, after 10-15 minutes of stupidly trying to mimic the daddy Prime, I’d disable the extension and code the old way. Every day for the next two to three weeks, I’d go through this initial ritual where I felt like a total moron for a straight 15 minutes, and then continue my day-to-day programming voyage with Ctrl, arrows, and mouse.

By the end of the third week—I don’t know when or how—but I suddenly found myself being "ONE" with Vim keybindings. The 15-minute ritual expanded a bit longer, and only when I hit a roadblock (for instance, not knowing how to search and replace text) would I find myself needing to revert. But otherwise, I could place my cursor exactly where my eyes wanted it to be with Vim keybindings without thinking or calculating. It felt like this was the right way to navigate the text. I wanted to use it everywhere.

I found this particular written series to be very helpful in explaining all the terminology I needed to know. There are also a few interesting talks from Vim cult members to make you believe that Vim is a real thing, and it’s worth beating your head around.

It’s been more than a month since I started learning Vim. I don’t feel fully confident yet doing development work there, which unfortunately still is React Frontend JS/TS Node. But I’ve set up Neovim (obviously), and I use it for a personal project(Go cli tool) I’m working on these days (I’m unemployed, by the way—so full time on a personal project, so full time on Neovim these days). And I guess configuring Frontend with NeoVim will be an awful experience, so I’ll avoid it totally.

I want to avoid configuration as much as possible. I’m not interested in ricing Neovim by adding cute icons, customizing fonts, or trying to turn it into a full IDE. I found Telescope to be the only plugin I needed so far for quickly jumping between buffers and searching files. For file navigation, Netwr is enough. My eyes are too used to one dark theme, so I added it. For now, my goal is to get efficient with defaults and avoid extra bloat as much as possible.

Overall, learning Vim has been a good experience so far. It’s a pain in the a**s at first—I even dreamed about typing the wrong Vim motion once and woke up with the most violent cramp in my lower leg. I guess it will get better.

Top comments (9)

Collapse
 
kurealnum profile image
Oscar

Well written! I always enjoy seeing people join the vim cult fanclub.

Collapse
 
sindbad_x profile image
Sindbad

@kurealnum i haven't sold my soul to the cult yet

Collapse
 
moopet profile image
Ben Sinclair

Oh you have, you just don't know it yet.

Thread Thread
 
sindbad_x profile image
Sindbad

👀👀👀👀👀

Collapse
 
acudworth3 profile image
acudworth3

Don't be afraid to use a distribution like Astro, lazy or Chad neovim. It's a bit of a short cut but will keep you using neovim quicker. After a while you'll want to do the configs yourself to get it just right (in my experience).

Configuring for front end won't be much trouble if you go that route .

Collapse
 
navneet_verma profile image
Navneet Verma

Nice article, your experience motivated me to learn vim myself! But is Vim for everyone, What do you think ?

Collapse
 
pengeszikra profile image
Peter Vivo

My opinion is vim is great for every one, because more or less on certain point we are facing a terminal -> shell, during our works. If we are forcing to use windows as developer environment, then I suggest to select gitBash as termina, that is give a near same experience as linux or MacOs shell does.
VIM are installed!
But at the old days I am don't spend time to understund this great editor. Which are seems wierd at first moment compared to nano. But if we spen a bit time to understand the basic movement, than that is good starting point at least to use as side editor, when we don't want to leave a shell.

best movement:

o -> turn to insert mode and we get a new line under current one to write
: -> back to normal mode
:q! -> back to normal mode and close without save
:wq -> back to normal mode save our modification and quit
:e start-typing-filename -> back to normal mode and open any file to read or edit, you get all helps as OS give. Mainly tab help is good at this point.

So I recommended to learn vim to every one.

Collapse
 
sindbad_x profile image
Sindbad • Edited

@pengeszikra agree! at some point, you will be greeted with vi in shell and i remember first time, wondering if this program is broken or what. nothing happened on pressing any keystroke, so i killed the terminal and going to bed in confusion. I wish i had took some time to understand what it was, because now i feel i missed an amazing tool that i would like to carry with myself throughout this programming journey. And you know what, it's not even that hard. Just takes a little time to get used to this mode of thinking and navigating the cursor and editing text.

Collapse
 
sindbad_x profile image
Sindbad

@navneet_verma i don't know if vim is for everyone but if you have some time, you can try it out and find it yourself.