How I Get (& Stay) Good at Vim

Vim is one of those tools that most everyone who uses a computer for most things outside of “regular” computer use (email, web banking, facebook, etc.) should use. Now, I realize that there are more than a few people on the webs that will defend their opinion of a command-line text editor (Vim or Emacs) more “enthusiastically” than a Jehovah’s Witness will defend their church’s beliefs, but a solid and feature-rich text editor that is available on any non-Windows computer by default is about as important as a keyboard. I, like many “whiz kids” started using Vim over Emacs because Vim is baked into pretty much every Linux based distribution out of the box. It’s not that I don’t like Emacs, just that when I need to get into a server and make a quick configuration change I don’t want to have to install anything to do it.

Now, there’s a great argument now that config management tools (like Chef, Puppet, Ansible, etc.) can install Emacs from the rip but I just don’t have the time. Well, let me clarify: I don’t have the time to learn another text editor like I’ve learned Vim over the years. Any merit that can be said about Emacs applies to Vim, and vice versa. They are both excellent text editors, very powerful but very simple at the same time. Both have tons of plugins, can be modified simply to aid in just about any context, and have excellent automation facilities. So, now that I’ve got that bit out of the way and have avoided about half of the Emacs vs Vim comments, let’s get into why you’re here.

Like any other tool, you need to use it to be able to use it. The more you type in Vim (or Emacs), the better you are at it and the more you build the muscle memory that lets you type really fast. Now, if you’re not needing to edit text-based files like config files every day, then you’ll have an issue with becoming and staying proficient. And I have a simple solution to this problem, use the tool to write every day. Now, I don’t know many people that use a command-line text editor for many things other than config files so you have to give a bit of a think on what you’re going to do every day to stay sharp in your text editor.

The best task that I have come up with that everyone should do every day on a Linux based machine is to journal. Just a simple, you are the audience, journal. Of course, there’s a ton of other things you can do but journaling is something I recommend to everyone. This is for a few reasons: 1) It can be cathartic, 2) it gives you some time to organize your thoughts, & 3) it generates a “paper trail” of what you’ve done. Now of course for #3 you’ll need to write some on what you did, not just keyboarding exercises. It only took me about a week to get into the habit each time I started doing this.

What I propose for organization and format is simple. In your home directory create a new directory ($ mkdir journal) and then make a new text file ($ vim aug-22-19.md). Now, this is simply a suggestion for the file name and location so make it your own. Formatting is simple as well. Inside the file, I start off with the date and time marked with a leading asterisk, then on the next line I write – stream of consciousness style. Simply writing what I’ve done so far in the day. When I’m done I save & quit (:wq). Once you get a bit of practice, I bet you’ll hardly notice that your brain isn’t slowing down to figure out how to write what’s in your brain!

When I find that I need to add to the file, I simply leave a blank line after the last entry and repeat the entire block. So, when you log into your server or whatever try this and make a record of what you did (and maybe even how you did it!). If for nothing else, you’ll be creating a simple paper trail of what you did, when and where. There’s a ton more to this topic, which I intend to. Until then, leave us your favorite tips and tricks for your favorite text editor.

Leave a comment

Your email address will not be published. Required fields are marked *