echo "hey, it works" > /dev/null

just enough to be dangerous

Fluid + GMail + Vim


I've been a vi and Vim user for a long time. As such, my most productive writing comes when I'm using my beloved modal editor. I'm also a long-time Mutt user, the main attraction being that I can edit my mail with Vim. Recently, I've started using GMail for my non-academic mail, so I can more cleanly drop into academic mode without distraction.

GMail is much better than Mutt at a couple of important things, the most obvious being search. Searching all your mail is a pain to set up in Mutt, but the simplest thing in GMail. Mutt is also quite slow opening large mailboxes, and it's impossible to save the same message in multiple 'places', as you can with GMail's labels.

But I really missed being able to write email in Vim. Good email communication requires chopping out stuff that's irrelevant to your reply, and snipping that stuff and keeping it readable is infinitely easier in Vim than in the pointy clicky world of a browser's textarea1.

While editing a long and involved email today, I pined on identica for Vim editing in GMail. I wasn't really expecting anyone to be able to suggest how I might achieve that but I quickly got a couple of useful leads. penryu suggested vimperator, which was supported by notjosh. Vimperator is an extension that makes Firefox behave in a kind of Vim-like way. I gave it a try but I couldn't work out how to use it as an editor for textareas2, and it seemed to have a bug (or possibly a conflict with the diigo toolbar) that meant I couldn't see anything I entered in Normal mode. So I ditched vimperator.

I had a small side journey looking at jsvi, a JavaScript reimplementation of vi, which I might revisit later to make a jQuery plugin, and extend that into a Habari plugin, but decided that was more than I wanted to do for the moment.

Next, screwtape and gavincarr suggested the It's All Text extension for Firefox. I managed to get that hooked up to MacVim (I couldn't get gvim to work) using the full path to the MacVim binary, in my case /Applications/MacPorts/MacVim.app/Contents/MacOS/MacVim. It seemed a little flaky in that it would only send the textarea to the buffer, and save edited content back, if MacVim wasn't open beforehand. That was okay because I use console Vim for everything else, and I can set MacVim to quit when the last window closes.

So, I was almost completely happy. The one down side was that I had been using Fluid to make a site-specific browser for GMail, which keeps my mail separate from my browser and seems to help keep Firefox's memory usage under control. But then, as I poked around MacVim's preferences I saw this.
MacVim's preferences
I'm willing to risk it for the moment. Enabling the external editor means I can have Fluid + GMail + Vim. Using the It's All Text Firefox extension means I can use Vim to edit wiki pages or write blog posts, like I'm doing with this one right now. And all that means I'm pretty happy.

[Update: I'm sure using MacVim as an external editor did work, but a day later edited text is no longer sent back to GMail. Sigh, perhaps I was imagining it. Now the closest I can get is cmd+A to select all the text in MacVim, close it, cmd+A to select all the text in GMail, then cmd+V to overwrite it with the edited text.]

  1. This is not your opportunity to say that it's even easier in emacs or textmate or notepad or whatever, because it's my blog and I like Vim, so there.
  2. Later, frt told me that you can achieve this with :set guioptions+=mT. I didn't try it, but I may revisit Vimperator in the future.

Mozilla authoring tools?


And speaking of Firefox ...

I just went to an interesting, if lightning paced, talk by Robert O'Callahan, who works for the Mozilla Corporation. He showed some pretty damn impressive SVG stuff in the Firefox 3 beta that I haven't seen before. He stressed that the point of Mozilla is to promote an open web, and part of that mission is to try to encourage developers to move away from using proprietary plugin based architecture, such as Flash and Silverlight, to do their cool stuff. That's all very well, but there are powerful authoring tools for Flash (I don't know about Silverlight) and not many for SVG. I didn't manage to ask the question, but I wonder if Mozilla would consider a foray into the world of authoring tools.

Firefox beta better, but still flawed


John Gruber has switched back to Safari after a dalliance with Firefox 3, and outlined some of the reasons for switching back. It's a feature comparison, and I don't know some of the Safari features or care about some of the Firefox shortcomings he mentions, but there isn't anything in his post that I disagree with. I've used Firefox exclusively for a number of years, and while there are definitely things about it that shit me, I can't see myself using any other browser any time soon. Gruber mentions the reason himself.

Perhaps the biggest difference between Safari and Firefox is that Firefox offers an official, supported extension API.

A host of incredibly useful extensions have been written using this API and, as a developer, there are some that I just couldn't live without, especially Firebug, and to a lesser extent the Web Developer Toolbar and Greasemonkey. Gruber says he suspects some developers browse with Safari and then move back to Firefox for development. That certainly wouldn't work for me, for two reasons. First, if you're moving between browsers—different shortcuts, different UIs, different metaphors—you're invariably going to be slower on both because there's extra cognitive load. Second, there isn't really much difference between my daily browsing and my development. I jump back and forth between things all the time, and that level of separation wouldn't work for me. My daily browsing overlaps too much with my development.

So, what shits me? I'll start off by agreeing with Gruber.

Location Field—The new Firefox 3 location field, the so-called “AwesomeBar”, is too clever. When I click the mouse in the middle of a URL, I just want to place the insertion point. I don’t want to select the entire URL. If I wanted to select the entire URL, I’d double-click. Click to place, double-click to select—just like any other text field.

[Update: Not long after I posted, and via Gruber, I came across an about:config change to insert the cursor rather than select the entire URL, as well as a post that goes through Gruber's list point by point and provides a justification for this behaviour that sounds pretty reasonable.]

Related to this is that if you're in the location or search fields and switch away from Firefox to another application, switching back selects the entire field. I was also bothered by the fact that if you start typing in the AwesomeBar and a match is selected from your history, and you backspace over the last part of the URL to, for example, go to a different page on that site, then hit enter, you don't go to the URL in the location bar but to the matched URL. Thankfully, this has been fixed in beta 5.

Firefox 3 adds a new inline toolbar for password saving, similar to the inline text search bar that both Safari and Firefox now have. This password bar is very slick — it’s small and non-modal, staying out of the way until after you’ve finished logging into a site, at which point you can decide whether you want to allow Firefox to save your credentials for this site.

I agree it's great that I can avoid saving incorrect passwords and that the page can be loading while I'm thinking about whether I want to save the password, but I used to be able to dismiss the modal window with the keyboard. Now if I want Firefox to remember my password I have to use the mouse. I don't like to use the mouse. If I'm wrong, and I can do it from the keyboard, someone please enlighten me.

Anyone else using the Firefox 3 beta and have things that shit them?

Mozilla Developer News » Blog Archive » Firefox 3 Beta 2 now available for download


Performance improvements such as: better data reliability for user profiles, architectural improvements to speed up page rendering, over 330 memory leak fixes, a new XPCOM cycle collector to reduce entire classes of leaks, and reductions in the memory footprint.

I've never written a big piece of software, so maybe this is an unreasonable question to ask, but how did 330 memory leaks get into Firefox in the first place? The Fox is definitely my preferred browser but it's piss poor performance has been bugging the shit out of me lately, and I have been considering using it only for development and using something else for day-to-day browsing. Performance boosts more than welcome.

I hate the mouse


I hate using a mouse. I much prefer to work with the keyboard. I also do a lot of work in a browser. One of the most useful keyboard shortcuts I've come across in Firefox is the apostrophe. If you want to go to a link, simply type ' and start typing the link text. For example, gootodo doesn't have any keyboard shortcuts, but I can create a new todo by typing 'new and hitting enter. That's quicker than moving my hand to the mouse and moving to the link.

You can also go to the detail of a particular todo by typing the todo (if you have the 'Find text as you type' option selected), pressing tab to get to the detail link and hitting enter.