So long, Vim. I’m returning to Emacs

I’d been using Emacs for quite awhile, and about 8 months ago I decided I would try using Vim. I’d only used vi for system emergency work, but knew a number of people that swore by it for regular work. So I decided I would learn Vim and use it for my regular work. I figure that with things like this, I don’t get a real feel for how well they work unless I use them for all my work. So I haven’t really opened Emacs at all in the past 8 months.

Yesterday I finally decided that Vim was not living up to my expectations and I’m in the process of switching back to Emacs. I thought I ought to write down why I’m doing that, for my own future reference… and since nobody has ever written about Emacs vs. Vim, I might as well post it where everyone can see it.

So here we are.

Original Reasons for Using Vim

It would lead to more comfortable typing. Lots of Vim users mention that you don’t have to hold down keys while hitting other keys as much in Vim as in Emacs, and that the movement keys are all on the home row. That’s true, but I didn’t find it to be that big of an improvement, since Esc is a farther reach than anything in Emacs, and let me tell you, you’re hitting Esc all the time in Vim. I found that removing the armrests from my chair made my hands happier than Vim ever did, and swapping Ctrl and CapsLock in Emacs will probably help there too.

It starts faster. I’m not sure if that really was true even when I switched, but it certainly isn’t true on any of my machines today. Both Vim and Emacs have had major version upgrades (v7 and v22, respectively) since I started using Vim. People seem to say that Emacs 22 feels faster, though I don’t know if that’s true. The startup times of the two, if they’re different, are imperceptible.

Vim would use less RAM. Frankly, these days, both Emacs and Vim are way down on the list of things that use up RAM. Heck, kmail has 141MB resident, and each of its two IMAP processes is using more than 30MB. Emacs in X right after start has 16MB resident, 10MB of which is shared, and 25MB VSS. gvim right after start has 8MB resident, 5MB of which is shared, and a 43MB VSS. Emacs tends to use fewer processes for things that vim. So they’re not all that different, and Emacs could come out smaller in certain situations. But the difference is irrelevant on today’s machines, and modern Gnome and KDE apps are many times larger than both of them.

It will make me more comfortable in rescue environments where I have only traditional vi available. Actually, the vi on AIX is so different from modern Vim that this didn’t really help.

It would make me more productive. There are some editing commands that did, but as you’ll see below, it was more than balanced out by other problems.

Things I Liked about Vim

The commands dt, dT, df, dF. Wonderful little things those. Emacs now has M-z (Zap), which is similar to df but can actually go to other lines (a nice addition). And there are easy ways to bind keys to the others as well, though that doesn’t make it a pervasive convention like it is in Vim.

Antialiased fonts. It’s crazy that Emacs doesn’t have this yet. But not a showstopper; I still like good ole 10×20 just fine.

Regexp search-and-replace. Emacs actually has this now, and maybe it had it back then too. M-C-%. Apparently in Emacs22 the replacement expression can also have lisp code in it, which sounds really slick but I can’t see myself using it regularly.

Annoying Things in Vim

Syntax highlighting. The syntax highlighting for most languages in Vim felt like it was about as smart as it was in Emacs about 10 years ago. Strings like "Hello!\"" (in languages where \” inserts a literal “) often confused it. Sometimes quotes within comments confused it. Sometimes it would be confused permanently. Other times, just until I scrolled around in the file or reloaded it.

Indentation. This is much more annoying than the syntax highlighting, really. In many languages — and especially the two modes I’ve used most recently, XML and Haskell — it really, really stinks. The indentation there isn’t aware of syntax, or not very much. Sometimes it is smart enough to know that if an XML line starts with </ that it moves left and if it starts with an opening tag, that the next line moves right. But it’s not smart enough to do this reliably. Not only that, but indentation is not handled with consistent configuration between languages. And even though Vim ships with a ton of language modes, the central docs only cover indentation for C.

I’ve asked Vim experts about this, and have tried all sorts of various tweaks, have read through Vim indentation mode source files, etc. There is just no way to get it anywhere near the intelligence of Emacs for most languages, short of writing my own mode, it appears. This is even worse because when using the backspace key in insert mode, for awhile it deletes individual spaces, and then all of a sudden deletes a big chunk of whitespace back to the beginning of the line. (And no, the insertion of Tab characters is disabled.) Indentation is my complaint about Vim, and something that shows no progress towards being fixed any time soon.

And forget about anything like Emacs M-x reindent-region. This is a syntax-aware indenter. You can write out an entire source file with no indentation whatsoever, and it will indent the entire thing according to the indentation rules you’ve defined and the syntax of the language you’re using. The best I’ve seen in Vim are commands that add or remove space at the beginning of every line in a region.

In short, Emacs seems to “understand” the file format on a much deeper level than Vim, and can automate things to a much better extent because of it.

Too many things disrupt the paste buffer. I can use Y or y to yank some text in Vim, and it’s really, really easy to overwrite that buffer with other things. Yes, I know that I can yank it into a named buffer, but that’s inconvenient and I don’t usually know in advance that I’ll have that need. In Emacs, only C-k and other “large area” commands disrupt it.

Vim doesn’t like you having lots of files open at once. It’s surprisingly convoluted to do this. If you use the basic documented command to edit another file, :e, it closes the file you’re working on. The normal way to open multiple files at once is to use split windows. Well, I don’t like split windows all that well, and often just want to make a quick change in one file — in full screen — and then go back to another. Even though I use set hidden in my ~/.vimrc, it still is annoying and more convoluted than it should be.

Vim can’t create new top-level X windows. In Emacs, I can press C-x 5 2, and poof, I have a second Emacs window in X, and it’s tied to the same editing session and Emacs process. Not a new process, with a different set of files, its own buffers, etc. The same process, same set of files. Just like a split window, but with a new top-level X window instead. gvim simply has no way to do that. This is also a large annoyance.

gqap stinks. This has burned me more than once. I’ll be editing an XML document, and insert some text in the middle of a paragraph. Now I have a really wide line. So I type gqap to reformat the paragraph. My cursor is near the bottom of the screen, so I don’t really see much past the current line. I then save the document and exit. Later I discover that vim considered the entire rest of the document part of the single paragraph, and removed all the different indentation levels at </para> and the like, so it’s completely messed up. Emacs is smart enough to know what is a paragraph in XML mode, and M-q does the right thing. Oh, and Emacs reindent-region can fix the Vim gqap-induced mess.

Review: Terk TV38 Antenna

Last year, as we were planning our move, I knew we would need to buy a new TV antenna. According to AntennaWeb (a very useful site), we are in the violet (or “fat chance”) zone for several TV stations. Add to that the fact that we have a tin-covered building pretty much in the direct path to several of the transmitter. Metal buildings often cause “multipathing”, where a signal bounces off buildings and arrives multiple times at the antenna. This causes ghosting on analog signals and can cause problems getting a signal lock on digital ones. We also have a fairly long run from the antenna to the receiver (a MythTV box) and are wanting to receive digital signals. Not only that, but the TV transmitters are in different areas about 40 degrees apart, and most high-gain antennas are also highly directional. So it’s a difficult situation.

So in our situation, an outdoor antenna is a must. At our old place, we had used the best outdoor antenna Radio Shack sold. Despite having more friendly reception conditions, it didn’t work well.

After a good deal of research, I bought a Terk TV38 outdoor antenna from Amazon. It comes with:

  • The antenna, at a large 12.5 feet long, 9.25 feet wide, 2.6 feet high (though packaged in a much smaller carton)
  • A 5-foot mast
  • Chimney mount
  • Wall mount
  • Transformer (for direct connection to coax cabling)
  • Various mounting hardware

It comes with the hardware you need to mount it in an attic or attach it to an exterior wall or chimney in most situations. However, we wanted to attach it to the roof directly, so we purchased a tripod mount from RadioShack for that purpose. I had also purchased some quad-shield RG6 coax from Cat5ECableGuy.Com.

I assembled the antenna on the ground. That took some time, but wasn’t difficult. But this was in winter, a fairly wet winter, and I knew that weather wouldn’t cooperate well enough for us to get the antenna up on our roof safely some Saturday for a few weeks. So I thought I’d just leave the antenna on the ground for a little while, hook it up, and see if we get anything. I put it on the ground, aimed it about in the middle of the TV transmitters, and went to set up the MythTV.

I was shocked to discover that, even with the antenna on the ground, I got a perfect digital picture on all channels but one. Once we got the antenna mounted on the roof, reception has been perfect. I’ve had no need for actuators (to rotate the antenna) or amplifiers. Just the antenna itself, even with the long coax run, has performed quite well.

For anyone that needs an outdoor antenna, I highly recommend the Terk TV38.

Young People NOT Delinquent?

Here’s an interesting and probably controversial article. It starts with:

When I hear people my age (35+) rip the younger generation I usually keep my mouth shut. But I have something I need to say, so this is my public response to the people who think there is something wrong with young people today.

Let me tell you what I think about young people:

The kids coming of age right now are the greatest generation, and we don’t give them the respect and freedom we were given and it is shameful.

And it goes on from there.

Also I should point out that George Bush is a baby boomer.

Hey Dell, Can You Hear Me Now?

A couple of years ago, I had an apparent lapse of judgement and bought a 21″ Dell LCD because it seemed to be a good monitor and a good price. Even after my earlier experiences with Dell.

Last winter, it developed an odd dim area in the shape of an L. It was under warranty.

I made the mistake of contacting Dell support. It probably took 2-3 hours of calling before they agreed to replace it. I’m pretty sure I said each of these things to them at least 5 times:

  • No, it does not have an Express Service Tag. It has only a serial number tag, and no, it is not the same format as the Express Service Tag.
  • No, my computer doesn’t have an Express Service Tag either. It is not a Dell computer.
  • Yes, it is possible to use a Dell monitor with another kind of computer.
  • Yes, I did buy the monitor from Dell. Would you like the order number?
  • No, hooking it up to another computer doesn’t change it. Do you remember I told you that the area looks green even when the monitor is OFF?
  • I was just talking to someone else, who was going to transfer me to some other department, but (hung up on me, sent me to a busy signal, sent me to a menu that accepts no input) instead.

Eventually I spoke to somebody that understood the concept of a serial number and agreed to send me a replacement monitor. I made the mistake of giving them a shipping address for that.

Ever since then, they have sent me stupid catalogs.

NO, DELL, I DO NOT WANT TO BUY A FLAMINGO PINK INSPIRON NOTEBOOK

that is what I think each week when I get such a catalog.

I have gone to their website to try to get off of these mailings. They have different privacy forms for their different units (home, small business, etc.), and I sent in a removal form for all of them. That didn’t help. I called their customer service department, and after getting the run around yet again, they said they’d take me off right away. That didn’t help either. This was all months ago. They are blatantly violating their stated privacy policy.

Today I got another magazine. Featuring Flamingo Pink inspirons yet again. And a page that says “Raze your standards.” Need I say more?

I will therefore be following the advice of Junkbusters.com and will file a Prohibitory Order against Dell at my earliest convenience. That’s the first time I’ve been motivated to do that.

And if they don’t honor that, they’ll be hearing from the postal inspectors.

Dell has now become my most despised company ever. Yes, even more than Sprint.

Spineless Democrats

The Democrats ran in 2008 on the platform of ending the Iraq war, and won largely on that platform. Now they are failing to deliver upon it.

It is true that they have a thin majority in the Senate and a not much wider one in the House. It is also true that it takes 60 votes to pass legislation in the Senate, which they don’t have.

But here’s the thing. It takes 60 votes to pass legislation. That means that they can easily defeat any massive Republican war spending bill.

I think they are worried about the Republicans painting them as being against the troops. So what? If the Republicans vote against a Democratic funding bill that provides adequate funds for an orderly withdrawal, aren’t they doing the same? “No” votes on both are votes to prevent the funding from passing.

They easily have the votes to defeat massive Republican spending bills. So why not advance a spending bill like they campaigned for, and watch all the Republicans vote against it? If no funding at all passes, they achieve their objective, just not as cleanly, and the Republicans would be the ones voting against funding. Make the Republicans take some heat for a change, and give them no choice but to compromise.