DrupalDork.com was shut down on September 18, 2013. This is just a snapshot of the site as it appeared then.

Alfred Shortcuts for Drupal Developers

During the BarCamp-style afternoon session at DrupalCamp MD last weekend, some people got talking about the tools they use on a daily basis, including one of my favorites: Alfred, a launcher app that's comparable to Quicksilver or LaunchBar. I have several Drupal-specific custom searches setup in Alfred, and I've been meaning to write about them for the benefit of other Drupal devs on Macs.

To add custom searches, open the Alfred preferences and go to the Features tab, then select Custom Searches in the list at left. Click the plus icon at the bottom of the window to add a new one. You'll be asked to provide some info for the search, including the keyword to use—the command you'll type into the Alfred window—and the URL that the search should go to. You'll put {query} in the URL where the search string should go.

So, for example, I have a Netflix search. The keyword is 'nf', and the search URL is http://movies.netflix.com/WiSearch?v1={query}. If I hit Command+Space to open Alfred, and type 'nf the goonies', Alfred will launch http://movies.netflix.com/WiSearch?v1=the goonies.

These are the Drupal-related searches that I have configured in Alfred:

dmod: Jump directly to the given Drupal module or theme. Example: dmod views, dmod omega
Search URL: http://drupal.org/project/{query}

dmods: Search Drupal modules. Example: dmods feeds
Search URL: http://drupal.org/project/modules?text={query}

dapi: Search the API. If an exact function name is given, the d.o search will redirect to that API page. If not, it performs a regular search. This is limited to D6 since most of my current developement is still for 6. Example: dapi hook_nodeapi, dapi taxonomy_term_
Search URL: http://api.drupal.org/api/search/6/{query}

d7: Same as dapi but for D7 only. Example: d7 hook_block_view
Search URL: http://api.drupal.org/api/search/7/{query}

capi: Search the contrib module API available at DrupalContrib.org. Like dapi, this searches D6 by default. Example: capi ctools_get_plugins
Search URL: http://drupalcontrib.org/api/search/6/{query}

d.o: This one isn't a search. It goes straight to my drupal.org dashboard, since I check it often for updates to issues I'm following. You'll need to swap in your own d.o user ID.
Search URL: http://drupal.org/user/660472/dashboard

php: Not Drupal-specific, but good to have on hand. This one searches the php.net function manual. Their search will redirect to the API page if a specific function name is provided, show manual pages for topics like arrays or XML, or do a sort-of search of function names if it's not an exact match. Example: php array_rand, php simplexml
Search URL: http://us.php.net/manual-lookup.php?pattern={query}

Category:

Comments

A lot of these can also be set up in chrome as custom search engines, in case folks aren't Alfred users: http://www.makeuseof.com/tag/create-custom-search-engines-google-chrome/

I neglected to mention that I've also got them duplicated in Chrome, so I can use the same shortcuts no matter where I am.

Add new comment