KeyBindings

Problem: Some key is triggering an unwanted action.

Solution: There might be two reasons for this:

  1. You created ~/Library/KeyBindings/DefaultKeyBinding.dict and made a typo. Try rename this file, relaunch TextMate and see if that fixes it.

  2. You accidentally assigned the key to a bundle item in the bundle editor. From the menus choose Bundles → Select Bundle Item… In the window which opens you can click the magnifying glass and switch the search from being on items titles to search key equivalents.


Problem: Some key is not triggering an action.

Solution: There might be two reasons for this:

  1. Keys listed in the menu which do not have the ⌘ modifier are not resolved by the OS X menu system, so instead rely on also having an entry in TextMate’s key bindings file (this does not apply for items in the various Bundles submenus). If you create your own key bindings file in ~/Library/Application Support/TextMate then it completely eclipse the default version. In this case you should copy over the bindings from the default file.

  2. TextMate is simply not seeing the key stroke. This might be because you have another program which eats the key. To debug this you can run Peter Maurer’s Key Codes to test how Cocoa programs see the key strokes you perform.

    If the key in question is ⌃⎋ (to open the bundle menu), then the problem is caused by Apple’s Remote Desktop application, you can disable ARD in System Preferences → Sharing (called Remote Management in Leopard). The Screen Sharing option in Leopard also steals this key combination.

    Instruments.app from Xcode 4 also grabs ⌃⎋ (bundle menu) per default. It does not even have to be running, just having Xcode 4 installed seems to be enough. The solution is to launch Instruments.app and change the default key combo for "Toggle Front Document Trace" in Preferences to something else.

    If the key is ⌘[ and [ is achieved with ⌥8 on your keymap then the problem is likely that the system has the system-wide Zoom On/Off key bound to ⌥⌘8 — you can go to System Preferences → Keyboard & Mouse and adjust or disable the Zoom On/Off key.

See also: 101