Banging out the HTML

I suspect I heard about the Emacs zencoding mode from its (I believe) original author, Chris Done—he did a screencast about using Emacs for Haskell development that I found interesting, and I imagine that I found a reference while looking at his material about that.

Anyway, I created a Debian package for it, and installed it…and didn’t use it for squat. Although the idea makes great sense—use a CSS-selector like language to create HTML (an idea I was first exposed to with Kris Zyp’s put-selector JavaScript library)—I never even bothered to learn the keystroke to activate it.

Now, however, is the time—I’m doing some HTML writing these days, so I thought I’d go back and start learning it.

So, the magic keystroke is C-j (zencoding-expand-line) or C-RETURN. The language…well, I will probably have to refer back to the cheat-sheet on the github page now and again—it’s like CSS, without entirely being CSS—but I expect it will take a lot of the really repetitive boilerplate out of writing HTML for me.

That’s why the editor is a tramp?

I suppose that was the obvious joke.

Here’s something that I’ve known about for awhile, and used occasionally, but have only now decided I will learn and retain: you can edit local files as another user (including root) using TRAMP and sudo.

All you have to do is C-x C-f (find-file) to open a file, then type /sudo:. This will start prompting you for the user and host information, and then a password (your password), at which point you will be able to use filename autocompletion and such to your heart’s content to load a file that you would otherwise not be able to access.

This is awesome. Eventually I will even get used to using TRAMP via ssh to edit stuff remotely, but for the moment, not having to switch to a terminal and do sudo emacs -nw <foo> is enough.