Make control-h backspace in TextMate

In macOS, ^h (AKA control + h or ctrl h) will usually delete backward one character, i.e. do the same thing as backspace or what Apple labels delete on its keyboards. Therefore it’s somewhat disconcerting that ^h in TextMate runs “Documentation for Word” or similar “Documentation for Current Word” actions.

Here’s how to disable the default control-h behaviour in TextMate 2.0, and get backspace behaviour instead.

From the menu bar, click Bundles > Select Bundle Item.

screenshot of TextMate Select Bundle Item dialog

From the gear menu in the “Select Bundle Item” dialog, select “Key Equivalent”.

TextMate Select Bundle Item dialog searching for ^h key equivalent

In the search box, press ^h.

Then for each of the matching documentation actions (there may be several from different bundles), click “edit” then clear the “Key equivalent” field in the side drawer. Close the bundles window and save.

screenshot of the TextMate bundle editor

Repeat the previous step for any other bundles that define a documentation action for ^h.

WordPress GCS plugin broken thumbnails

The GCS plugin for WordPress lets you use Google Cloud Storage for WordPress’s media and other uploads. This is required on stateless environments like App Engine, where there’s no persistent writable filesystem to store uploads.

However, image thumbnailing and rescaling is broken by default when using the plugin, so while you can upload an image, the thumbnails that usually get automatically generated will never appear in the GCS bucket. So if you add high-resolution images to a post, load times will be massively increased, which is a particularly bad experience for low-resolution mobile devices.

I raised a WordPress ticket and attached a patch that fixes the issue. The patch needs to be applied to the core WordPress installation (rather than being a plugin), so may not be an option for WordPress admins that are using multisite hosting. I think a plugin-based fix would be possible (one that replaced the default image editor with a fixed one), but would involve duplicating a bunch of code from core WordPress.

Continue reading “WordPress GCS plugin broken thumbnails”

macOS Help menu keyboard shortcut

macOS has a handy Search field in the Help menu, which lets you search the help content and also other menu actions. This is great when you want to navigate the menus quickly with a keyboard.

macOS Help menu Search

So how do you focus that search box with the keyboard? Well, there’s a default keyboard shortcut for the help menu bound to โ‡งโŒ˜/ (Shift + Command + /):

default macOS keyboard shortcut for the help menu

However, most people will find this doesn’t open the help menu / action search; instead it opens the application’s documentation. That’s because apps already bind โŒ˜? to the documentation, and ? is equivalent to Shift + / on most keyboards.

So the fix is to bind another key combination from System Preferences > Keyboard > Shortcuts > App Shortcuts > All Applications. I use ^F12 (Ctrl + F12).