Editor Addiction

A couple of weeks ago, I purchased a Dell Inspiron 6400 to replace my old and quite literally beat-up PowerBook G4 Titanium. The PowerBook is slow, its screen is damaged, its paint’s chipping off, its wireless has never been especially good, and nowadays, I find myself politely wondering when the hard disk is going to simply keel over. It’s done an amazing job over the last six years, but I felt that it was time to let it take a much-needed rest.

Because I’ve been a diehard Mac user for nearly ten years now, I initially planned to get a MacBook. It was a reflex action. Need a computer, get a new Mac. Yet on further reflection, I began to think that maybe getting another Mac wasn’t the best idea. I do have two working Macs, after all (at least for now), I’ve been wanting a Linux machine, and you really can get more bang for the buck hardware-wise by buying a generic PC. I eventually caved into this line of thinking, and, With great trepidation, I finally settled on the Inspiron.

Overall, I’ve been quite happy with the machine. The machine came with an absolutely beautiful 1680x1050 display, the machine is fast (it easily clobbers my dual G5 in anything I try), and, to my slight surprise, Ubuntu 7.04, minus the install process, has been a dream to use (although in fairness I should point out that I am veteran of Slackware 3.0-era of Linux, so my sense of a dreamy, easy-to-use Linux is probably warped, to say the least).

So, I’ve put the PBG4 in my closet, along with my Newton 2100 and my Handspring, just another old device that I don’t use but can’t bare to part with.

Right?

Wrong.

If anything, over the last couple of weeks, I find myself using the PowerBook more heavily. And it’s not that I find OS X easier to use, or prettier, or anything like that.

It’s that, after having used TextMate for the last couple of years, I honestly just can’t stand going back to the likes of Emacs.

“What?!” I hear my devoted reader(s?) cry. “But, like, you just blogged about how you use Emacs for like everything! What gives? Where’s the love, man? Where’s your lispy love?”

I have a confession to make. I do use Emacs all day at work. It does let me have the same editing environment on my Mac and my PC, and that is a boon to my productivity. I honestly think ECB, CEDET, JDEE, EDiff, and even the much-maligned Eshell are beautifully written, wonderful packages. And although I gave up using Emacs as my mail client after we switched to Exchange at work, I still have Gnus rearing to go the second I change my mind.

But here’s the thing: I’d really just rather be working in TextMate.

I won’t lie. TextMate can’t do everything that Emacs and my carefully crafted dot-file can do, and there are definitely some things that TextMate does far worse or not at all. (I’m pretty sure you couldn’t write a TextMate plugin even dimly resembling GUD, for example, which is sad, because extensions like GUD played a big role in drawing me to Emacs initially.) But what it really comes down to is that while Emacs may operate the same way everywhere, TextMate to me feels as if it acts the right way, if only on my Mac.

Rather than having my choice of carting around a ridiculously large .emacs with key remappings or simply using the arcane and contorted control and meta combinations everywhere, TextMate honors and extends normal Mac OS conventions in a good enough way that I don’t feel compelled to readjust everything. The third-party packages for TextMate are generally far easier to use, more transparent in operation, and more compact than their Emacs equivalents. Bundles can easily be swapped in and out without learning anything more complicated than drag-and-drop. The GUI actually looks like the GUI that’s used in every other program I’m in all day, yet manages to provide me with exceptional power anyway—and even passes on some of that power to my scripts. TextMate really has become the environment that I go to when I just want to get things done, right now—and at least in that sense has completely supplanted Emacs as my editor-of-choice.

I don’t think I’m ever going to completely give up Emacs, but my workflow in Emacs feels convoluted enough that returning to TextMate always leaves me feeling…relieved. Given the choice between my stolid PowerBook with TextMate and my blazingly fast Inspiron with Ubuntu and Emacs, I’ve found myself taking the PowerBook more often than not. I’m keeping a very close eye on e, but after having tried to use it for a few days, I feel strongly that it’s just not there yet. (And even if it were, its developer won’t be releasing a Linux version for awhile, which kind of defeats the point of me having a Linux laptop.)

I’m not sure that the Inspiron was a bad purchase, but I’ve definitely learned not to underestimate the value of your existing software packages when choosing a computer. At least for me, TextMate will be the quintessential example of why it’s so hard to give up the Mac.

It Says Quiet Car for a Reason

I’m currently on an Acela bound from New York to Boston. The train’s unfortunately full, so I got stuck in the quiet car. I’d much prefer to be able to talk on my cell phone, but because the upper half of the Northeast Corridor is absolutely beautiful, I placed a high premium on getting a window seat. Choosing between facing backwards on an aisle with my cell phone or looking at the lakes and forests rush by at 120 MPH, I’ll take the latter.

That said, I’m somewhat dumbfounded by how few people are actually respecting the quiet car rules. The fellow sitting in front of me markedly refuses to silence his Blackberry, which fires every several minutes. Cell phones in general are going off every couple of minutes. A few people are listening to music through headphones, but have them turned up so loudly that I can hear them quite clearly.

If Amtrak is going to have a “quiet car,” the least they could do is actually enforce their own rules. As-is, it’s only penalizing people who are trying to be respectful.

Everybody Dies

I was extremely happy to discover today that Ambrosia Software has finished porting Introversion’s DEFCON to the Mac. DEFCON is a happy-go-lucky simulation of global thermonuclear war. Each player controls a collection of boomers (nuclear-missile-armed submarines), missile silos, aircraft carriers, and airfields in an interface highly reminiscent of NORAD as depicted in the movie WarGames. Over the course of the game—which can range from a few minutes to a full eight hours—players compete to disarm their opponents while inflicting the highest number of causalities possible, as measured in millions of deaths. Although arguably ghoulish, the game’s surprisingly well-done, from the intuitive controls to the fairly solid AI to the quiet weeping that fills your ears as the first ICBMs kiss the ground. It’s not going to displace the Empire Earth series as my favorite strategy game, but it’s a very nice diversion. You can grab a demo from Ambrosia’s website.

Oh, Hells No!

So Google already has my email. They already know what news I read and what hobbies I have. They have my essays, my portfolio, my photos, and even my encrypted bookmarks and passwords, not to mention my code, my data, my spending habits, and my readership.

This morning, I log into Google, and discover that they’re now willing to track everything I do at any time anywhere on the internet and show it to me in a cute and cuddly UI.

I’m getting to the point where I’m having serious trouble convincing myself it’s possible to have an irrational paranoia of Google.

Switching Control and Caps Lock on Windows

I’m a diehard Emacs user. When I first get into the office, I fire up Emacs, then check my mail in Emacs, then update all of my source files using either the built-in Subversion bindings or a Cygwin shell via Emacs, and finally get down to coding for the day in Emacs. Windows and Mac OS X at times feel like just the kernel that allows me to run Emacs.

Productivity-wise, that’s actually a great thing. My work environment is basically identical no matter what machine I’m on, enabling me to focus on coding instead of trying to remember exactly what keystroke does build versus clean build versus debug build on which platform. Unfortunately, Emacs relies heavily on the Control key. On older Unix systems, Control was conveniently placed directly next to the “A” key, which made it easy to use without turning your hand into a compact pretzel. On modern Mac and PC keyboards, you’re out of luck: the Control key has been relegated to the bottom-left-hand corner of the keyboard, making it hard to reach without contorting your hand.

Thankfully, fixing this deficiency is a piece of cake. On the Mac, the process is a bit confusing, but fairly straightforward: simply open System Preferences, go to Keyboard and Mouse, pick the Keyboard Tab, click on Modifiers, and set the Control key to be Caps Lock and Caps Lock to be Control. GNOME users have basically the same process: they must click Settings, Preferences, Keyboard, go to Layout Options, and then toggle what key they want to register as their Control key from among several options. In both cases, the setting takes place immediately. You do not need to log out or reboot.

On Windows, thankfully, the process is considerably more straightforward. First, open regedit (Start, Run, type regedit) and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout. (N.B.: Keyboard Layout, not Keyboard Layouts. They’re different.) Next, right-click in the values field, choose New, and then choose “Binary Value”. Name the new field Scancode Map. The Scancode Map is a little-endian—encoded field that allows you to remap arbitrary keys. The header is simple: the first word is the version (all zeros), the next word is reserved (all zeros), and the third word is the little-endian—encoded count of how many keys you will be setting, plus one extra for good luck. So, if you’re only swapping your Control and Caps Lock keys—two custom mappings—your binary field should read 00000000 00000000 03000000. The next entries are the actual remappings, encoded as key to map (two bytes) and key to map it to (two bytes). Looking up the scancodes for Caps Lock and Control, we see that the former is 0x3A and the latter is 0x1D. So, to map control to Caps Lock, and accounting for the little-endian encoding, the next two words should be 3A001D00 1D003A00. Finally, we have a one-word null terminator, all zeros. The final value for the Scancode Map binary value, then, is 00000000 00000000 03000000 3A001D00 1D003A00 00000000. Make sure you’ve entered the key correctly, then reboot your machine. Presto! Caps Lock and Control reversed.

Give it a try. Even if you don’t use Emacs or a similar Control-heavy editor much, you may still find the reduced contortion when using the Control key is more than worth it.