It's Vim! a big lump of modes
Table of contents
"Vim is beautiful, little child". I'd have argued half-dead against the last statement about 7 months ago when my love for Vim died with my last faithful Linux PC (RIP, my Dell Inspiron 15).
I'm only writing this article because of this GIF here (I'm sorry, it takes a while to load):
You can come back to see it later.
Backstory
So, last quarter of 2021 just before all Tom, Dicks, and Harrys were planning what to write for their year review (mine's still in draft to this day), Melody's scream about Vim finally pierced my only working ear (the right one) and in an instant, I was downloading Vim with:
$ sudo apt install vim
I used Vim for the entire quarter and loved it. I missed my VSCode whilst learning the commands to do lots of stuff. I mean, I couldn't see all changed files from a git extension, or use the Docker extension (I've never touched it up till now, so don't fret) but over time I began to get comfortable with it.
As usual, the "realistic" shits in Javascripters made a billion arguments against it and they did make sense - as expected. I knew Vim was toxic. I knew it drilled my insides, but damn it was good.
Imagine not ever having to leave your keyboard for ANYTHING?! Yes, child, it's true. Vim is that editor that allowed you to do literally anything you needed to do with just your keyboard. No need for the mouse if you don't want to. You navigate left, right, down and up with keys: h, l, j, and k respectively. With 4 different modes of interacting with an editor that runs directly on the Terminal, you'll literally be greater than Madara when it comes to ingenuity.
You'll raise your hands about extensions... Vim. Has. Them. Yeah, you install with a command I can't remember and use them immediately. You can also change your theme, split your screen into 3,000 tabs (that's not the limit, chief), and run the commands you want; all with the keyboard.
To the present
I dropped Vim in January when my personal and work PC got stolen. Such an evil day. I've continued with VSCode as my editor of choice to this day, only using Vim when I have to add a commit message for merges at work.
But today! I wanted to write a script for other devs working on a pet project (pay me, and I'll make the repo public). so they could set up the entire code base by running just the script. Out of mere instinct, I
$ sudo apt install vim
On this Ubuntu machine and did:
vim pull.sh
I typed the first line and then moved to the second. Since the repositories had similar prefixes, I decided to copy and paste. That was when it happened.
The last time I used the Vim copy and paste feature was about 11 months ago. This time, my hands moved of their own accord: ESC k vlllllllllllllllllllllllll y j p
which is Vim-speak for:
ESC - Enter normal mode
K - Go up one line
vlllllllllllllllllllllllll - Select characters to the left (each "l" is one character to the left)
y - Yank (as per copy)
j - Go to the next line
p - Paste
In the middle of this, I forced my brain to remember the commands, but it didn't work, so I gave the rest to muscle memory which did the job well.
Then I remember the Vim scripture that said:
...and most importantly, once the muscle memory has been ingrained, it’s nearly impossible to switch to something else. - Stackoverflow
Twas a wonder! I know how many times I've switched to a new machine and have had to look up VSCode command shortcuts because I had issues remembering the SHIFT + CTRL + ALT + FN combos.
So what?
Lol, I'm not going back to Vim, but it's worth a try by you, especially if you want to claim the Poweruser title lots of Linux and Vim punks are known to chase.
Some guides to work with Vim are available below:
- Openvim: https://www.openvim.com/
- Learn vim while playing games: https://vim-adventures.com/
- A YouTube video on Vim: https://www.youtube.com/watch?v=RZ4p-saaQkc
Am I paid by Vim to write this?
Yes. Ignorant child, yes :)
Oh, go back to check the GIF above.
Subscribe to my newsletter
Read articles from Adeoti Ayodeji directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Adeoti Ayodeji
Adeoti Ayodeji
Software engineer, attracted to complex things by nature; passionate about Rust.