Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Textmate: remap Escape for word completion

Tags:

textmate

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)

like image 258
Julius Eckert Avatar asked Jul 17 '09 18:07

Julius Eckert


2 Answers

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
like image 97
Debajit Avatar answered Nov 18 '22 13:11

Debajit


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 (->|).

like image 43
andi Avatar answered Nov 18 '22 14:11

andi