Wednesday, September 30, 2009

The Oldest Flame War

At least, if it's not, it's certainly the most well known: vi vs emacs. I'm not here to say one is better than the other, only to say why I finally wound up switching.

I've been a ViM user for about a decade, and been very happy with it for the most part. I preferred gvim, since I liked having the GUI window. I wrote up a fairly complex .vimrc, pulled in vim tips, read books, and overall did quite a bit with it. I even tossed in a few of the old nuggets at emacs: Good OS, needs a good text editor; must have 12 fingers to work, etc.

The only thing that ever presented a problem was because I don't much care for screen, and frequently find myself editing the same file from two different locations. The end result was dealing .swp files, sometimes lost edits due to them, etc. It was frustrating, but it was my own fault, and there was nothing I could do, especially not while I addicted to gvim.

Then, I read an article on Slashdot: emacs 23 had just been released, and with that release came daemon mode. daemon mode is so much more than just a simple screen session, and I'm worried I'll not do the explanation justice, but I'll try.

With daemon mode, there is an actual daemon running in the background that holds all of your buffers. The client connects to that daemon, and displays your buffers. The end result is that you can have GUI mode, text mode, and even both modes in different connections. For example, I have the GUI mode running at my workstation at work. I come home, VPN into work, and use the text mode to edit the self-same buffers. I can't have .swp files in the way, since I'm editing the same pieces of memory as I would at my desk at work.

It's an amazing thing. I put items into my todo list (maintained via orgmode), leave work, edit the list at home, etc. And my edits cross the boundaries between GUI and text mode without me actually having to do anything.

I've discovered the joys of tramp: I can use sudo to edit files, ssh to edit files, ftp to edit files, and I get tab completion all the way.

I participate in IRC, and use ERC, the Emacs IRC client. My IRC windows stay open, as do my editing buffers. I get a shell, so I don't even have as much need of a regular command line.

Daemon mode opened my eyes, and with each day ViM would have to do more to get me to switch back. It's not impossible, but I don't believe it will happen.

I've defected from ViM, and gone over to Emacs. At least I like my new OS.

No comments: