Doug Rudolph


Why VIm? - Part One

Posted on June 13th, 2017

VIm is a text editor that has been around since the beginning and has really stood the test of time. With the creation of more modern text editors like Sublime Text and even just improved ports of VIm, such as Emacs, why is there still a large group of VIm users?

  1. Introduction
  2. Disclaimer
  3. The First Law of VIm

Introduction

It all started in a database class during my sophomore year of college when studying computer science; and at the time, I was zoning out in class - as you do throughout a 3 hour lecture. And I guess the professor must have been talking about something boring because I felt unmotivated to listen to any detail of his lecture. After several minutes of dozing off and trying to just take a small break without being spotted, I see my professor quickly open VIm to edit an SQL file that he had written as a demo for our lecture. Without hesitation, my professor jumps through several lines of code and quickly goes in and out of his editor in under 20 seconds. “What did he write?" you might ask. Well, it was Perl script that systematically made changes to an SQL file. And while that might have taken me several minutes to write, to him it was just an old flick of the wrist.

Now real quick, for those of you who have never seen someone with the slightest bit of experience work with VIm - let this sink in.


vim-1


You can imagine he regained my attention. You see, writing in VIm is not the same as writing in other editors. It’s so agile. So exuberant. Enabling you to navigate with precision. Really letting you think about not just what you're typing, but how you type it.

Fundementally, while VIm can be thought of as just a text editor, what makes VIm so interesting is that interacting with VIm is done through language itself; one where if spoken correctly, can make all aspects of your life more productive. This my friends, is VIm.

So lets back up a second. While I'm still reminiscing about my early days of college, I can't go on without mentioning my former text editor nano. Yes, I was using nano, a small, simple, and approachable editor that many noobs (like myself) pick up when they first start toying within a unix shell. And let me tell you, there is nothing special to this editor. It can save, copy/paste, and well, it can jump to line numbers. And that’s ... really about all it can do. Just look at the shortcuts.


vim-2


And you see, I can already tell some of you are thinking, “How long does it take to learn VIm? Why not just learn other text editors like Sublime? Why not just use an IDE? y u no Emacs?" While all these questions are valid, everyone dances around the core question that all these converge towards. So let me propose this question to you; Why VIm?

You see, I get asked this question a lot when I try to share my admiration and excitement for VIm; and often times, people look at me like I have four heads when I try to explain how the equivalent of a cat walking along your keyboard can somehow optimizes your work flow. And while some people might think I invest too much time into something arbitrarily meaningless, getting familiar with VIm is arguably one of my most productive hobbies that I have learned. So with all this said, I’m trying to make it my job to explain the answer to the question, “Why VIm?” And as long as you are capable of looking past some odd quirks in the beginning, then hopefully by the end of this blog, I would have convinced you to at least appreciate VIm from a fresh and open perspective. Okay? Okay.

Disclaimer

So the first thing to learn about VIm is, “why invest all this time?” - and rather explaining why you should study VIm by showing off interesting shortcuts, or by detailing how customizable VIm truly is, I think it’s more useful to take a moment to simply contrast VIm with other text editors, and explain what other text editors are doing differently.

Now before I get to this topic, I want to add a disclaimer. I don’t want to spend too much time on this because I think:

  1. I will probably start a war with an audience who is surfing the internet with sole intent to defend what is the motherland - Emacs users, I’m looking at you.
  2. To simply put it, other text editors were built with different intentions in mind, and those creations were meant to be used by a wide spectrum of users.

So really, what you should be taking away from this is not, “Why are other text editors bad”, but rather, “What is VIm’s purpose in the text editing realm”. Now with that out of the way, what are other text editors doing differently and why should you care?

The First Law of VIm

As an attempt to explain VIm’s unique perspective, I’m going start off by comparing VIm to its second cousin Emacs. Okay, it’s hard to talk about this subject without mentioning the history and relationship VIm and Emacs have, because … well … these two text editors have been in a 10 year long war, and it’s vital to address this. You see, what makes this specific topic so interesting is that Emacs, at least in the classical sense, is the superior text editor to VIm in every way possible way - and I’ll be the first to comfortably admit this fact. No matter how much you love VIm, and no matter the reason you might dislike the Emacs user base, VIm is only a subset of Emacs, and it’s a fact that has to be accepted as a VIm user.

Okay I know, you didn’t see this coming; but let’s pause - and please, just hear me out. Emacs was developed and released to the public in the year 2005, and was designed with the original intent of being an operating system. With the scope of a project that vast, you can imagine why Emacs gets so much praise. It’s often referred to as a behemoth for a reason, and a well thought out one at that.

And you see, why Emacs does get all this praise, I want to propose the question I asked you early, Why VIm? The answer to this directly correlates with the problem Emacs tries to solve.

So Emacs, once decided it should to be a text editor, was gracefully designed such that you never had to leave. Emacs was given a terminal emulator so that you can compile your code in parallel in the same window. Emacs includes its own window managing system so that you can look at as much text as you need. And all the while these features were implemented to simply increase productivity, it’s easy to forget that these tools are slow to load, and are just one more thing to memorize; and this is where VIm and Emacs diverge. While Emacs is designed to essentially be a text based OS, VIm thrives on being small, agile, and fast. The features that come with Emacs are often times unnecessary, and are a core reason as to why VIm is still alive and well.

And don’t think I don’t know that some of you whom are professional Emacs users are asking yourselves, “Who wouldn’t want a working terminal emulator, a highly accurate VIm keyboard layout, a personal notepad, customizable config files via a Lisp dialect, and about 1.7 gigabytes more of highly detailed features?” But that’s just it, VIm is for the minimalist, while Emacs is for those seeking something profuse. This right here is the first law of VIm; and I think both VIm and Emacs users often forget this. And while it may be true that VIm has extensions, which has the potential to make VIm just as clunky and slow as Emacs, these concepts are contrasting the core differences between both vanilla releases of either text editor.

To be continued ...