How can I switch between textmate and terminal quickly?

Is it possible to have a short cut so I can jump between Textmate and terminal quickly?

I know I can do it via cmd+tab but I still have to find it from the menu bar.


Solution 1:

There are a couple of ways doing this.

The quickest and easiest is to use Spaces.

Put Textmate on Desktop 4 and Terminal on Desktop 3

Then you can use ctrl-option and either 3 or 4 to switch between the two.

Personally I use Keyboard Maestro for this. I used to use a Service and a keyboard shortcut but a "feature" of the new security system makes it impossible for a Service to use the System Event library unless you turn on accessibility for every app. You need that to select "Bring All to Front".

Solution 2:

I currently use KeyRemap4MacBook to assign shortcuts to applications. For example this private.xml would make F7 open iTerm and control-option-command-M open TextMate:

<?xml version="1.0"?>
<root>
  <vkopenurldef><name>KeyCode::VK_OPEN_URL_ITERM</name><url>file:///Applications/iTerm.app</url></vkopenurldef>
  <vkopenurldef><name>KeyCode::VK_OPEN_URL_TEXTMATE</name><url>file:///Applications/TextMate.app</url></vkopenurldef>
  <item>
    <name>test</name>
    <identifier>test</identifier>
    <autogen>__KeyToKey__ KeyCode::F7 | ModifierFlag::NONE, KeyCode::VK_OPEN_URL_ITERM</autogen>
    <autogen>__KeyToKey__ KeyCode::M, VK_CONTROL | VK_OPTION | VK_COMMAND | ModifierFlag::NONE, KeyCode::VK_OPEN_URL_TEXTMATE</autogen>
 </item>
</root>

If you have bought the Powerpack for Alfred, you can create a workflow like this:

Hotkeys have a short delay by default, but you can reduce it by changing the trigger behavior: