Why Vi is so cool… And Why you aren’t good enough at it.

17
Aug
0

If you said that you were a master at vi, that statement alone would allow to conclude one of two things:

  1. You’re probably one of the best or most experienced programmers alive.
  2. You’re full of it.

Even If I had just met you that very second, I could already conclude as much. Why? Vi is just that difficult of a text editor to master. And people tend to think that they’ve mastered it way too quickly. In fact, I thought that I had learned most of what vi had to offer until recently, when I borrowed a book on it. After reading ten pages into it, I made the realization that most so-called pros make sooner or later: I had no idea what I was doing.

Now,  as far as VI users are concerned, There are three classifications:

Beginner

So you just heard about this awesome text editor from a friend. Moving around with the hjkl keys is really foreign: why not just use the up down left right instead? I wrote code just as quickly on notepad!

Here is where a lot of people start. Generally when people pick up vi, it’s the first visual editor that they’ve used before. It’s surprising how much time is wasted just trying to get somewhere.

Intermediate

Moving around is no problem. I know how to substitute/replace. Sometimes I find there’s something I don’t know how to do, so I look it up. I see one of those crazy commands that starts with a colon, so I’ll try that out.

This is the phase I used to be at (and I’m trying to get out of).  In this phase, any command involving the colon seems like a ton of crazy jargon, and you’re able to figure out a variable or two to chisel the command to doing what you want it to do.

Advanced

People like this will make fun of anyone else’s use of vi, and they have the right to. They have mastered every command vi has to offer, and use it on a fairly regular basis. Using any editor besides vi is an affront, unless of course they want to use ex.

These people have probably been using vi or ex since they were kids, back when it was the only way to do things. It’s very rare that I come across someone like this, but I can’t say I haven’t.

Most people will find themselves in the intermediate category. All of my programming jobs have been at a university, so maybe my dynamic is a little skewed. However, whenever I’ve talked to someone about vi, I can tell that their level is that of “I know enough commands to get by”.

Originally, I thought that way too. I’ve been using vi for over a year. Since I was always more concerned about making sure that code gets done, rather than learning how to use the editor efficiently. However, I began to realize that the two are combined.

vi has roughly a hundred commands. That’s not a negligible amount. At first glance, it might seem that some of these aren’t even worth remembering. But the funny thing is, it is. If you are a programmer, think about how much time you spend editing text. Think about how much time is wasted raising your hand, setting it down on the mouse, and clicking on the spot you want to move to. Or, think about the minutes that you spend copying lines of text and modifying one thing. Over the days, months, and years, you end up wasting days worth of time picking your hand up or typing repetitive code. Time that you can spend working on optimizing your code, sword-fighting with wooden swords, and doing a better job in general, the bottom line reason for learning vi is:

Because every annoying and tedious line of code that needs to be copied, or every autonomous task that needs to inserted into the code, vi can do it for you.

Copy a paragraph and put insert it into line 52? it can be done:

“ay} 52gp

In eight characters. Think about how much time your saving:

  • The time it takes to copy the paragraph
  • The time it takes to navigate to line 52
  • The time it takes to paste it

All shortened into a second. The bottom line is, vi has so many features, it seems like an overwhelming amount of information, to the point that it may seem like it’ll save time just do these tasks manually and not worry about the shortcut. However, this cannot be farther from the truth.

If you don’t know vi, or think you know most of the commands already, take the day, week (or even weeks) to learn it completely. You’ll be amazed at your increase in efficiency, and the decrease in frustration caused by repetitive tasks.

Filed under: Uncategorized

Shark Vs. Plane

5
Jun
0

Filed under: Uncategorized

All about Signals

3
Jun
1

I liked my signals class for EE so much, I wrote a song for it:

A whole new orld...

It’s hard to read, so I’ll just type it here:

A whole new woooooorld
A new fantastic point of viewww

Frequencies are fast or slow, and their transforms show
When you use a fil-ter

Seriously, I loved this signals class.

Filed under: Uncategorized

A good idea

27
May
0

A good idea is like a bird: It might come back a second time, but don’t count on it. Take a picture just in case.

Filed under: Uncategorized