Emacs vs. Vi: The Showdown

,

Why is vi(m) superior to Emacs? Many reasons, the two chief ones being:Vi man

  1. modes
  2. chicks.   —>

Standard disclaimer: I have used both editors for significant amounts of time.

Modal editing is the single most powerful tool in an editor’s repertoire. Faithful Emacs users will, of course, complain and reference “beep mode.” Presumably the real complaint is that vi has a steep learning curve. When you open an editor, you should be able to type and see text, not be reprimanded by malicious beeping.

I’ll grant that vi has a learning curve. To be as productive as in a plain editor a la Word/notepad, it takes a day or so. To be as productive as in Emacs, it’ll take some practice. But you can’t tell me vi is any more difficult or cryptic than Emacs. Which looks easier?

  1. :wq
  2. control-x control-c

My fingers hurt just trying to imagine holding control/meta for every text operation. Modes offer sheer power. Rather than just having operations available to you via holding the control/meta keys, which is incredibly awkward with almost any modern keyboard, you have your entire keyboard available. Every key works together to alter text as fast as you can think. It’s rather impossible to describe the magic you can work with a few keys, but I’ve been using vi for years and still learn every day.

Beyond saving your fingers from meta-hell what does vi offer, you wonder? Well, it’s a text editor, for one. Emacs is more like the OS from hell, all packaged into one convenient huge binary. If I were an Emacs user, I’d at least have its startup time to blame for posting infrequently. Vi edits text. Emacs claims to, but it also claims to read email, newsgroups, the internet, calendars, IRC, play Tetris… Emacs has plugins to do just about anything except suck up all your memory – that, my friend, it does by default. Vim has plugins to edit text. Hrm.. that sounds about right for a text editor. Not to mention instant loading and a tiny footprint, while packing in all that power.

I know Emacs users can’t leave this one to the books, though. “Vi is the devil, it won’t stop beeping.” Put half as much time into vi as you did into emacs, and you might begin to appreciate it. Hell, take the time to learn vi while emacs is loading. The subtle change of mindset will overtake you. As John Arundel said, “Watching a vi guru doing some heavy editing on a file, as her fingers fly over the keys and textual transformations sweep across the screen, one could believe that one is in the presence of supernatural powers.”

Tim O’Reilly uses vi, and sells twice as many vi books as emacs books.

:wq

Comments

15 responses to “Emacs vs. Vi: The Showdown”

  1. KTR Avatar
    KTR

    FANTASTIC! I started using Linux about 2 years ago, and didn’t have the slightest clue as to the power behind vim. I read, learned, read, tryed, read, and used…now I’m an addict! I agree, and can’t imagine why the hell anyone would want to ctrl this, meta that. Obviously I’m somewhat naive on this as I have only *tried* emacs 😦 But I feel so powerful with vim that I don’t think I’ll ever change…

    Like

  2. redshift Avatar

    Don’t worry, anything more than *trying* emacs just increases the pain. Ctrl-alt-meta-shift-X-C-R only gets more and more annoying as your wrists begin to hurt.

    Like

  3. Tinglong Avatar
    Tinglong

    Which looks easier?
    1. :wq

    should read:

    Which looks easier?

    Shift-:-w-q

    Like

  4. redshift Avatar

    I don’t know any way to get a colon other than using shift. (Well, I’m not going to use the Character Map, anyway.)

    Shift is in a natural location for your pinkies, and you use it constantly for capital letters. (I hope.) Control is in an inconvenient location and requires shifting your hand to perform any emacs commands.

    The only hand movement in vi is for escape, and many people remap it to be closer. (Yes, you can remap control for emacs, too, but that was only part of my reasoning above.)

    Like

  5. mef Avatar
    mef

    Well.. It should read:

    Esc Shift-: x Enter
    Ctrl-x-c

    if in “insert mode”

    otherwise:

    shift-: x enter
    vs Ctrl-x-c

    But not a good command to compare.. compare
    d4d j p ….to…. Ctrl-u 4 Ctrl-k Ctrl-n Ctrl-y
    simple edits, 5 strokes, one with a finger stuck on ctrl.

    Like

  6. redshift Avatar

    The vi version definitely seems easier to me. Using ctrl should be a rarity. I think at this point it’s just religion.

    Like

  7. boboboobobbo Avatar
    boboboobobbo

    ESC ESC ESC ESC ESC.

    :q.

    Emacs ftw.

    C-x C-c.

    Like

  8. miv Avatar
    miv

    Wow, I never use :wq.

    just type SHIFT+ZZ

    Like

  9. zmyrgel Avatar
    zmyrgel

    I recently switched from Vim to Emacs. I like the fact that I can do everything from single editor 🙂

    To contribute something meaningfull to this I agree that movement with vim htns (dvorak) keys is easier than with emacs. Emacs wins with the window management commands which to me seem just better.
    It is true too that Emacs is bloated, it takes a while to start so I rarely use it to do quick file edits as I used to do with vim. Now I use mg or if that isn’t available I use vim.

    Switching the ctrl key to caps lock is pretty mandatory with emacs. With vim I had Esc
    in it.

    Otherthing to my switch was that my vim started to get bloated too with its plugins. Writing vim plugins is pretty ‘useless’ skill as it uses vim-script language so it is useless talent outside vim. Emacs uses elisp so a lot of it carries to other lisp dialects.

    Overall, I would say, use what feels right for you. They both have different view on things but they’re both great tools.

    Like

  10. oversky Avatar
    oversky

    You should try pe2, F3 file is faster than :wq.

    Like

  11. gicxjo Avatar
    gicxjo

    I guess it is funny that people still comment this entry after 4 years. Anyway the things changed and today Emacs is even more bloated as before, as well as vim. The difference is that emacs has made much more advance and now it is even faster to start than vi -in server mode, otherwise it takes about 1sec.- , taking approximately the same amount of memory (some 9 mb against 6 in vi, both meaningless in today pcs.) I do agree that the modal way is better (but with some shortcuts). Today Vim is only better for quick edits, and just because it is simpler.

    Like

  12. gut Avatar
    gut

    :wq = 😡
    (that’s what I use)

    Like

  13. gut Avatar
    gut

    damned smilies.
    let’s put it this way: wq = x

    Like

  14. Peter Avatar
    Peter

    I switch from Vim to Emacs is not a text editor. It is a customizable environment for computing. Vim is a fantastic text editor and I use it frequently for editing config files. For tracking my notes and organizing data I have not found a tool that compares to ORGMode.

    Like

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s