[TxMt] "Unbinding" a menu command in TextMate

Allan Odgaard throw-away-1 at macromates.com
Tue Jul 31 19:11:19 UTC 2007


On 31. Jul 2007, at 19:32, Kenneth McDonald wrote:

> [...] is there a way to _unbind_ that menu item, so that it has  
> _no_ associated key binding? This can't be done using Ale's method.

See http://macromates.com/textmate/manual/ 
key_bindings#text_move_edit_actions

The binding you want to unbind is in the /path/‍to/‍ 
TextMate.app/‍Contents/‍Resources/‍KeyBindings.dict and you can  
supersede that file by creating your own under ~/Library/…

As for why the key needs this method, while still in the menu, is  
answered in the Key Bindings → Menu Items section. I recommend you  
read the full Key Bindings chapter, this might help get a better  
grasp of how key bindings are pieced together. And as I implied in my  
previous letter, this fragmentation comes from building on OS  
infrastructure, i.e. it is the OS which resolves menu keys (with the  
⌘ key) simply based on having the keys in the menu, and it is the OS  
which handles the key bindings dictionary, but used only for the  
first responder (i.e. the text editing area).

A *big* problem in just replacing all this OS code is that Cocoa, the  
framework I use to develop TextMate, is second-class when it comes to  
key events on the Mac platform, so there are things I simply cannot  
replicate, which the system handles just fine, and in fact there is  
inconsistency between how some bundle items get their keys resolved  
compared to menu items. There is a little hope for Leopard though…





More information about the textmate mailing list