David Tran

Vim Progress Update

I began my Vim journey a while back.

I am not using Vim at the time of writing this post.

Okay, now that all the Vim enthusiasts have left...

I am still using Vim key bindings because they are freaking amazing.

There goes all the Vim purists.

Just kidding! I have nothing against Vim enthusiasts or purists. On the contrary, I think that they are awesome and I bet they are much more productive than I can ever hope to be.

Let's not have a lynching today, okay? 🙂

Anyhow, I hope that you will continue on with this post and interpret my thoughts with an open mind regardless of your opinions of Vim. Maybe you will learn something or get a laugh out of my terrible humor.

Present Day

I said that I am not currently using Vim but rather just Vim key bindings. What the heck does that mean anyways?

What I mean is that I am using the Vim keyboard shortcuts in other editors via plugins. I am currently utilizing a few different editors at work and for personal projects but they are all configured with extensions or plugins that provide Vim key bindings.

To be honest, I can't remember not using Vim key bindings - even though that was less than 5 months ago. I feel more productive than I have ever felt when writing and have disdain for the moments when I need to reach for my mouse.

I am even using these keyboard shortcuts for writing my blog posts!

Actually, I still use Vim (and vi) once in a while on CLI systems or even on Unix based systems when I want to edit a file quickly. Learning the basics (e.i. how to quit the dang editor) comes in handy quite often!

Vim Integration

I am currently using Visual Studio Code (VSCode) as my main editor. Eclipse and Visual Studio are also part of my daily toolbelt that I unclip when necessary.

I am attempting to migrate projects to VSCode because of how much I love it. I am enthralled by its quickness as a text editor as it is not bloated by unnecessary tools that many IDEs contain.

Despite being a text editor at heart, you can customize it to your heart's content with extensions. Maybe I will compose an entire love letter (post) for VSCode in the future.

I am using the following plugins to super-charge my code creation:

  1. Vim for VSCode.
  2. VsVim for Visual Studio.
  3. Vrapper for Eclipse.

Common Key Bindings

Before I go over some of my favorite shortcuts, here is a great Vim cheat sheet. I actually have this printed and pinned to my cubicle at work! In addition to making me look cool, it allows me to quickly recall certain bindings.

The following are some of the key bindings that I use the most often and would cry if I did not have them. Feel free to use the cheat sheet to look up what they do!

  • h, j, k, l for navigating to specific letters or lines when used in combination with a number.
  • w, b, e, ge for traversing "words" easily.
  • dd for deleting my mistakes quickly - before anyone notices.
  • gg, G to get to the top of the file or end of the file, respectively.
  • c + OPERATOR to change almost any combination of words, lines, etc. This is the action I probably utilize the most.
  • LINE_NUMBER + G to jump to the specified line number. Especially useful when line numbers are displayed, which should always be the case!
  • y, p to "yank" (copy) and paste selections.

Wow, I actually use quite a number of key combinations now that I think about it. Unfortunately, I am also certain that I am forgetting some of my more frequently used bindings as well.

However, I hope that you can begin to see how useful these key bindings are for writing (not just code)!

Closing Thoughts

While I may not be enjoying the "pure Vim experience", I have gained a lot by learning to use Vim. I am able to edit files (somewhat) efficiently on servers with Vim or some variation of it.

More importantly, I have drastically improved my day-to-day code creation workflow with my arsenal of Vim key bindings and awesome plugins and extensions.

I cannot wait to have more "ah-ha" moments when I figure out ways to speed up actions that I have been repeating!

I hope that you will take a look (or second look) at Vim. You will definitely gain something even if you do not end up going the purist route.

What are your thoughts on using Vim in other editors? Are there any key bindings that you have found particularly useful?

Noticed a mistake in this post? Feel free to submit a pull request!