Tuesday, November 8, 2011

Geek Rant Number 01: vi Needs to Go Away

So, I need to edit configuration files in Linux and a quick Google search brings me to instructions on using the terminal shell to accomplish this task. They say to use this text editor called "vi" because it's "the bestest UNIX utility ever created!!!"... Uh huh, yeah.


Not knowing what lies ahead I blindly type "vi" next to my prompt along with the name of the file I need to edit. All of a sudden I'm greeted with the contents of the file filling my screen. My cursor is at the top, and there's no options to be seen anywhere. I'm like, "OK, well let's just edit the file and figure the rest out later." The edit I need is a few lines down so I hit the down arrow on my keyboard. Um, wait, what's this? The cursor moved several spaces to the right. I hit the down arrow again, same result. That's weird. I hit the left arrow to go back. I end up several more spaces to the right. I end up hitting all the arrows in succession and the cursor either moves right or not at all. What the heck is this?. All I want to do is move down a few lines and add something in. Once more, I turn to Google. I do a search for "using vi" and come up on this page of vi commands.

According to the website, vi has two modes, "command mode" and "edit mode." To move around you type different letters to go left, right up and down. That's intuitive. To make edits you have 23 letters and letter combinations to choose from that do everything from adding and inserting lines, overwriting and appending text, clipboard functions and deleting stuff. Then, once you're done, you have to hit "Esc" to go back to "command mode." Then, you have four options for getting out of there, and the first two (":x" and ":wq") do the same thing (writing over the original file with the new file), while ":q" quits and ":q!" quits without saving the file. I just hit ":x" and hoped it was the right one, then made a vow that if I ever come across another set of instructions that begins with "type vi..." I will immediately back out and find something different.

For the life of me, I cannot understand why in the world people are still using such antiquated programs like vi, going on and on about how great it is and easy to use. Because, news flash, it is not easy to use. Nano is easy; Gedit is easy; shoot, even the MS-DOS editor "edit" is easier than the mess of a program that is vi. I found out that the reason vi is so crazy with its "modes" and uselessness of the arrow keys is because it was created way back when UNIX terminals used those old keyboards that were nothing more than just the standard QWERTY keys. No number pad, no function keys and no arrow keys. In this respect, I can see why it became popular. It allowed you to do a lot of text-editing stuff with the limited amount of keys you had at your disposal. But, the thing is, nobody uses those keyboards anymore. We have function keys, and number pads, and, for heaven's sake, we have ARROWS! Let's get with the times and just let vi die a slow, painless death, in peace.

So, if you find yourself wanting to write out instructions on how to text edit in UNIX/Linux, and your first instinct is to start by invoking vi, just STOP, get in your car, go to the nearest Walmart and pick up one of these. Oh, and be sure to change out of your parachute pants and moonboots first, and put on some jeans and Nikes, lest your picture end up on People of Walmart. Don't say I didn't warn you.

No comments:

Post a Comment