One Editor to Rule Them All

May 03 2009 Published by Bryant under Programming

As a professional software developer, much of my day is spent editing text. In the words of the inestimable Jeff Attwood, we’re all glorified typists :

There’s precious little a programmer can do without touching the keyboard; it is the primary tool of our trade. I believe in practicing the fundamentals, and typing skills are as fundamental as it gets for programmers.

Steve Yegge also espouses the importance of a good text editor and that it’s the difference between good and great:

All of the greatest engineers in the world use Emacs. The world-changer types. Not the great gal in the cube next to you. Not Fred, the amazing guy down the hall. I’m talking about the greatest software developers of our profession, the ones who changed the face of the industry. The James Goslings, the Donald Knuths, the Paul Grahams, the Jamie Zawinskis, the Eric Bensons. Real engineers use Emacs. You have to be way smart to use it well, and it makes you incredibly powerful if you can master it. Go look over Paul Nordstrom’s shoulder while he works sometime, if you don’t believe me. It’s a real eye-opener for someone who’s used Visual Blub .NET-like IDEs their whole career.

Have I been crippling myself by working in VS.NET (or some MS IDE) most of my career?

If there was any tool to edit text faster, that would help me in almost everything I do. One way to edit text faster is to use the shortcut keys. It’s just so much quicker to never touch the mouse or leave the home row. But it drives me crazy that all the different editors that I work in have different shortcut keys and pop-up different dialog windows.

For VS.NET, I have to learn one set of shortcut keys; for SQL Enterprise Manager another; for notepad yet another. Wouldn’t it be nice if you could just use one editor with one set of shortcut keys for EVERYTHING? Wouldn’t it be even better if that editor was built with the idea that you never have to leave the home row keys to do important tasks like file navigation and searching?

Is there one editor that can RULE THEM ALL?

lghwr1024one-ring-to-rule-them-all-lord-of-the-rings-poster

Well, you can uninstall notepad because such an editor exists. It’s called vi.

It wasn’t forged in the fires of Mount Doom, instead it was forged in the basements of Berkley by the mighty Bill Joy. It’s been called Bill’s greatest gift to man:

Joy leaves a lasting legacy of work both in the general technology domain and at Sun Microsystems. The Sun co-founder announced this week that he is leaving the company. Among Joy’s list of achievements are BSD Unix, NFS, UltraSPARC designs and some work on Java. But it’s vi, created in 1976, that really captured Reg readers’ hearts. “Bill’s greatest gift to mankind was left off his list of achievements (in your article)… the vi editor,” writes reader Matthew Hawkins in Australia. “I can live without NFS, Java and related technologies. I’m not sure if I can live without vi.

Indeed. I’m inclined to agree and I’m not even a unix guy. I rarely touch the stuff. I make my living as a Microsoft developer, but let me tell you, those unix guys know how to make an editor.

Every piece of the editor has been lovingly thought out to work as efficiently as possible. Check out this list of what you can do with vi in a few simple keystrokes:

  • ZZ =  Quit and Save
  • dd = delete line
  • h j k l = move cursor (w/o leaving home row keys)
  • 10w = skip forward 10 words
  • %s/fred/joe/igc = globally replace fred with joe

All this with no annoying modal windows and no mouse!

Now, you do pay a price for all this productivity. The learning curve for vi starts steeply and continues as such. It’s best illustrated by this cartoon:

learningcurve

I’m sure you’re probably thinking how in the world can someone use vi as a replacement for VS.NET? Who in their right-mind would give up intellisense? You’d have to be crazy!!!

That’s true, but thanks to viemu (an integrated vi editor in VS.NET, SQL server and outlook) I can enjoy all of the goodness of vi without sacrificing the intellisense of  VS.NET. The creator of viemu even wrote a great article addressing people’s concerns called  Why, oh WHY, do those #?@! nutheads use vi?.

DISCLAIMER: Before some Emacs acolyte in a dark room starts a DDoS attack on me, let me say that Emacs, while it may be a great (the greatest?) editor, it did not have the same kind of options for deep integration with VS.NET (like viemu) so I just couldn’t realistically consider it for my needs. It seems that it didn’t make the transition to windows as seamlessly as vi.

So if you’d like to take your text editing to the next level, here’s a set of links to get you started:

  • Vi: Get your copy!
  • viemu: Integrate with VS.NET. Costs money but they have a 30-day trial.
  • vi lovers: Collection of links and material for those that love vi
  • Learning Vi: Great book for learning.

View Comments