tags:

views:

364

answers:

2

In the Textmate code-editor I use the Escape-key, for word completion, alot. Is there a way to bind another key-shortcut to its functionality ?

(ps: my CAPSLOCK is already CTRL)

+3  A: 

To remap the esc key you have to copy

/Applications/TextMate.app/Contents/Resources/KeyBindings.dict

to

~/Library/Application Support/TextMate/KeyBindings.dict

and then edit it, preferably using TextMate :) as Property List Editor messes up the codes.
Look for nextCompletion and previousCompletion and replace their values with whatever suits your needs best.
For example, you could replace \033 (code for esc) to \t (->|).

andi
This is cool, but now my tab doesn't work to add 2 spaces like it used to. Anyway to fix that?
MattDiPasquale
+3  A: 

A much better way to do this (and this applies to all Mac apps in general) is to

  • Open System Preferences > Keyboard & Mouse > Keyboard shortcuts
  • Click the + sign at the bottom
  • Choose TextMate from the application menu
  • Type the exact name of the menu command for next completion and previous completion
  • Now type the shortcut you want to use and click the Add button
Nocturne
the escape and tab key functionality does not have menu commands.
Julius Eckert
The escape key's menu command should be "Next Completion" (Edit > Completion > Next Completion). (Similarly you could also map "Previous Completion" -- I have mine mapped to Command+K and Command+Shift+K, and they work fine).
Nocturne
yay awesome :) thanks a lot
Julius Eckert
is it possible to map it to the tab key this way? didn't seem so...
MattDiPasquale