vi versus emacs

I want to say “vi rules, emacs drools” but the fact is both are powerful editors used by millions of people and each has its own strengths and weaknesses. I have worked on a variety of *NIX systems over the years and currently work on Linux and Solaris. I’ve never sat down at a system where vi isn’t installed, so vi is a great tool to have in your back pocket as a developer or sysadmin.

I have to admit I like IDEs like Eclipse, Xcode, or Visual Studio for certain tasks, especially with higher level languages I’m not as familiar with. But it’s equally efficient to sit at a big monitor (or two) with a bunch of Xwindows open in several workspaces, each window containing a specific task you’re working on (e.g. editing a file, compiling a project, grepping for something) and each workspace representing a different project or high level task you’re working on. It does take awhile to get up to speed with an X-type development environment and vi fits that paradigm, requiring some up-front effort to learn how to use it efficiently, and it also requires a good memory because you not only have to remember all the commands but also which windows contain which tasks.

I actually use vim on Windows and OS-X as well because it’s just a very simple and fast editor. vim also gives you lots of GUI-editor capabilities that traditional command line vi doesn’t have.

So I guess this is a long way of saying it’s very helpful to be competent with vi if you’re a coder or sysadmin, but there are also programming tasks that benefit from an IDE. You can learn emacs instead of vi but emacs has a different focus. emacs was designed to be extensible at the expense of some simplicity (how many editors come with lisp built in?) and you can extend emacs to do virtually any computing task given enough time and knowledge. vi was apparently designed to be fast and lightweight, somewhat extensible but not a kitchen sink tool, and it fulfills that design goal very well.

I could go into a discussion of how vi best fits the *NIX paradigm of “tools should do one thing and do it well”, but that risks provoking another battle in the ongoing “vi versus emacs” holy war … 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *