steve on Apr 6th 2010 tech
I’ve been meaning to get around to it for the longest time, but I finally switched over my Mac’s to use bash as the default shell (previously I had it set to tcsh). I’ve become more accustomed to bash the past few years as its the default shell on pretty much any unix/linux nowadays, so it was time to migrate.
The migration itself was pretty easy, but I wanted to gain some of bash’s features, specifically the emac-like keystrokes for moving forward/back a word in the command line, and also to the beginning and end of the line. The keystrokes, among others, are:
ctrl-a Move cursor to beginning of line
ctrl-e Move cursor to end of line
meta-b Move cursor back one word
meta-f Move cursor forward one word
ctrl-w Cut the last word
ctrl-u Cut everything before the cursor
ctrl-k Cut everything after the cursor
ctrl-y Paste the last thing to be cut
ctrl-_ Undo
I’m a big fan of iTerm – I use it as my primary terminal and have been for the last few years, as it matured in terms of performance and has a lot of great features. The most compelling feature it has over the built in OSX Terminal.app, for me, is that you can specify which characters to include when selecting words. A common operation in a terminal is to select a path, i.e. /home/myuser/testfile. In Terminal.app, if you double click on home, it will just select home – so you have to go back, double click on the first “/” character, and mouse right to get the whole word. With iTerm, you can set a preference with characters to include when connecting, i.e. “/”, so when I double click on home in iTerm, it selects the full path. Specifically, in iTerm -> Preferences -> Mouse, i have “Characters considered part of word:” set to /-_.
One thing I couldn’t figure out was how to get the “meta” key in iterm set to the alt/option key on the mac keyboard. Turns out it’s buried in a non-intuitive place, but it can be done. In iTerm, go to Bookmarks->Manage Profiles, and under Keyboard Profiles select Global. On the right side, you need to set Option Key as “+Esc” for this to work – yes, its strange that it has to be Esc instead of Meta, but hey, at least it all works.
steve on Jun 18th 2008 tech
Download/Install UseMetaKeys FireFox Extension
In celebration of the release of Firefox 3 yesterday (and since I had forgotten to install my extension previously), I am posting this quick, dirty, and oh so helpful firefox extension.
Firefox has long been my preferred browser, although for the last year or so Safari had been gaining ground. Firefox 2 was just to bloated and slow, especially on OS X, and Safari was much faster. I always had a hard time choosing between the additional functionality Firefox provides, and the simplicity and speed of Safari. With Firefox 3, that’s pretty much over, and it is back in its place as my primary browser.
However, one thing that has always bugged me about firefox on Mac OS X was that you can’t open a URL in a new tab using Command+Enter, it only works with Option(alt)+Enter. I couldn’t find a fix a year or two ago, and with some quick searching today, I still did not find a good way to reassign the key sequence. So, I looked up a couple howto’s, found a sample/donor project, and whipped up a simple extension with a single purpose – remap Command-Enter to open a url in a new tab (i.e. when typing in the address or search bars). As expected, no support is provided, no warranty intended, etc., but if you’re using Firefox on OS X, I highly suggest installing this.
For some reason, I called it “UseMetaKeys”, and now, a year later, I am too lazy to change the name.
steve on Feb 21st 2008 tech
I upgraded my home MacBook and work iMac to Leopard right when it came out. When I had Tiger, I installed an extention to Mail.app called “IMAP-IDLE”, which added support for the (logically named) IMAP Idle mode. This basically means that it will open an extra connection to your mail server, and when the mail server receives a new message, it notifies your client almost instantly. At work we have a Microsoft Exchange server, and for personal email I use gmail, and both were lightning fast – when I tested at work, I would see the new email in my inbox within a second of sending.
However, this behavior stopped when I upgraded to Leopard – it includes a built-in option to use IMAP IDLE, but it never seemed to work right – I would receive email only when I hit the “Get Mail” button, or my client checked on its specified interval.
I thought I had figured out how to make it work properly, it seems there are two settings that should impact this, but neither work well. Under Mail.app Preferences, under the Accounts Section, Advanced tab, if you select “Use IDLE command if the server supports it“, and you un-check “Include when automatically checking for new mail“, things work ok for a while. After making the change, restart Mail.app. However, if something happens, i.e. you close the lid on your laptop, lose the connection to the server, etc., it no longer works.
Why can’t apple get this working as well as the plugin was before? No good solution at this point…