Joshua Spann

Being More Productive Using Vim

Sketchy Vim Logo

May 17, 2018

There are 3 ways to edit text: a text editor, a word editor, and a code editor. There are a thousand different tools to all do the same thing. Notepad, edit, scite, emacs, vs code, vim, the list goes on. Most of these tools use the same keybindinds we’ve been taught since birth: Ctrl-c, Ctrl-v, Ctrl-s, Opt-←, Opt-→, Alt-→, Ctrl-Shift-Home, Ctrl-Delete, and on into the blissful oblivion of carpal tunnel!

I can’t tell you how many times I’ve simply had immense pains in that muscle or nerve between my pinky and middle finger. Sometimes it’ll even come up at the craziest of times. I became very familiar with the Home, End, PgUp, PgDn, and Ctrl-←, Ctrl-→, Ctrl-↑, Ctrl-↓, Ctrl-Home, and Ctrl-End combos to save me reaching for a mouse. Though these key combos were great, they really made me hurt in the long run. Then enters Vim. Like all noobs, I spent 6 hours in Vim because I could not figure out how to close the thing. That was 2014. I learned using a, i, x, $, and Esc. Then I learned :wq. That was all.

Now I’ve been studying vim for the past few months and have been growing by leaps and bounds. Vim is crazy fast if you put in the time and effort to learn it. The modal editing threw me off, but it has some perks:

To be more productive with thesse above commands with the universe of other commands in Vim, you need to take the time to practice and improve them. The only way I will effectively learn a new tool is to get a hardcore setup and use it on that. In other words, I use it in production. This is not highly recommended by anyone, especially seasoned pros. They take time, learning parts and pieces bit-by-bit during their free time. I tend to slack off during free time, watching cat videos or looking up memes about cats online. The only way to get better is to create a project and a need to use that tool. The entire notebook-based iteration of my SIUE website was written in vim. Using the UNIX mindset, I used vim as a link in a chain of tools to compile, build, and test the website.

But why stop at a simple website that takes a few hours to go through? Why not use it in a web app? Why not use it in a desktop app? Why not use it to create a flutter app? The possibilities are endless. I’m not suggesting learning and using vim at work, just use it for the unimportant parts at first. For your personal projects, jump to it and only it. You will grow in enough time. The best way I leaned to really use Vim was in thoughtBot videos and a plethora of articles online. I took it in chunks and slowly used the pieces in production-ready projects until it became second nature.

Here are some neat links that will help you reach that wow, ohmerhgursh WOW-like– dood ( O.O) moment with vim: