I have the ThinkGeek t-shirt with the little boy and his dad peering around the corner at the cop car and the boy asking “Why are hiding from the police, daddy?” to which Dad responds “Because we use emacs son, they use vi.”
Of course there’s also a different version of the shirt where the words emacs and vi are reversed, but that’s the whole point—some people use vi and others use emacs.
One of fellows I follow on Twitter (@jandrusk) posted a link to a long (and old) list of reasons to like emacs over vi. I posted my agreement to my followers. So far, there’s been three types of responses:
- emacs isn’t installed by default, but vi is, so use vi (link)
- I used to use emacs and once I tried vim (a vi variant), I never went back (link)
- I like the old-school feel of vi (link)
Three in favor of vi and two in favor of emacs. Frankly, I was waiting for the rebuke about starting holy wars about such subjects, but it hasn’t come (yet).
I prefer emacs to vi for a few main reasons.
- It was the first editor I used on those NeXT boxes in the late `80s.
- The keystrokes were largely compatible with Interleaf, the desktop publishing tool I first wrote code for.
- Both Interleaf and emacs share a huge LISP background and heritage.
- Emacs feels like a code processor rather than just an editor.
I find that I have to add several other tools to vi to get the same things done (grep, awk, sed and bash) as what I can do in emacs. In short, I’m comfortable (through long experience) getting complex things done in emacs.
And that highlights the whole argument. We use what we use largely because given a choice, that particular editor is what we prefer. They both edit text files well and that’s the job that needs done sometimes when you’re a System Administrator.
But since a System Administrator is going to find vi on every machine they work on, learn vi first. And after that, dabble in emacs.
So, what’s the answer to the question emacs or vi?
Learn vi, then explore emacs.
You’ll be a poorer System Administrator if you don’t learn the tool you’ll find in even the barest of tool chests. Because ultimately, it’s about getting the job done and being productive for your client.
Update: I found the t-shirt, included a cleaned-up photo of it and changed the quote to match the shirt (20110113).