#5 - vi
March 23rd, 2008
Vi is a modal text editor for programmers. In one mode, you can delete words, duplicate words, or store them. Pretty much every single key on the keyboard corresponds to a mode. The second mode allows one to type words into the document. Vi allows you to type text without using the mouse all the time. You don’t have to go to ‘find’ in the menu with your mouse. You just have to type “/word_to_search_for” and then press “n” to cycle through those words. You can even press ‘*’ to find the next occurrence of the word the cursor is currently on.
This is cool.
Even though this is a a dead simple little wordpress blog, I’ve used vi to modify its Cascading Style Sheets and to fix the .htaccess file.
As a tool, it’s great to have. The one thing I like about it is that it’s always there. I use it for this Ruby on Rails website I’m making, I’ve used to make cell phone games, I’ve used it for C and C++ code. I always use it for projects, and the advantage here is that I don’t have to learn new concepts every time I do something new. Most programming is writing text files, compiling those programs, and then debugging them. Knowing vi (along with a Linux/Unix shell environment) eliminates the concept shifting that would occurs when one switches tools. The simplest example would be switching mobile phones and you have to learn entirely new ways to look at the contact list, a new way to set the alarm, and so on. Without vi, I’d have to relearn new concepts every time I move to a new project.
Vi has been battle tested and refined for over 30 years now. It’s a myth that whatever is newest is automatically the greatest in computer land. Programming is a craft, and the tools that are used must be refined and improved on the same timescale as any of humanity’s other tools. I’m positive that Hammer Version 1.0 did not have a nail puller on the other end; this was something that was developed later as the tool was being used in the field.
The wikipedia entry for vi explains it all.
Now, programming text editors written in 1976 aren’t the most popular thing around. There will be no bars in Moscow named ‘vi’; no one will ever name their children ‘vi’; and there will never be a movie about the origins of vi. That last one’s a shame, it would be riveting. Let’s start reading the script on page 59, shall we?
Page 59 - The Untitled Vi Movie
INT: BASEMENT. DARKLY LIT, TILE CEILING. CALIFORNIA.
PROGRAMMER 1
Hey, I know you’re working hard, Programmer 2, but I just have to say one thing. I think the user should press ‘r’ to remove that text. Not ‘d’.
PROGRAMMER 2
But we’ve already assigned ‘d’ to duplicate. We can’t change it, not at this stage. We’ve already written the symbolic hyper-tree, you goat kisser. Maybe we should use these fancy new ctrl keys?
PROGRAMMER 1
NOOOOOOOOO! Not Want!
PROGRAMMER 1 suddenly throws a FLAMING CALCULATOR at PROGRAMMER 2
END OF SECOND ACT
EXT: SUNNY DAY. COLLEGE CAMPUS.
COLLEGE STUDENTS are protesting the war, and they are being sprayed with water by some FIREMEN wearing NIXON masks. PROGRAMMER 2 is walking on the other side of the street as that ‘California Dreaming’ song plays.
Entry Filed under: Work

Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed