Recently, I needed to unbind a TextMate menu command (Text:Reformat and Justify) so that I could use ^J for my own uses. Ale Munoz (the n is suppose to have a tilde above it but I don't know how to type that on a US keyboard, sorry) was kind enough to show me how to use the Mouse and Keyboard preferences panel to rebind that menu item to something else, which solves the immediate problem. However, this still begs the question; 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.
Thanks, Ken
On 7/31/07, Kenneth McDonald kenneth.m.mcdonald@sbcglobal.net wrote:
Recently, I needed to unbind a TextMate menu command (Text:Reformat and Justify) so that I could use ^J for my own uses. Ale Munoz (the n is suppose to have a tilde above it but I don't know how to type that on a US keyboard, sorry) was kind enough to show me how to use the Mouse and Keyboard preferences panel to rebind that menu item to something else, which solves the immediate problem. However, this still begs the question; 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.
I guess that you need Menu master from Unsanity for it (http://unsanity.com/haxies/menumaster) - but I didn't test that haxie myself
Niels
On Jul 31, 2007, at 1:32 PM, Kenneth McDonald wrote:
Recently, I needed to unbind a TextMate menu command (Text:Reformat and Justify) so that I could use ^J for my own uses. Ale Munoz (the n is suppose to have a tilde above it but I don't know how to type that on a US keyboard, sorry) was kind enough to show me how to use the Mouse and Keyboard preferences panel to rebind that menu item to something else, which solves the immediate problem. However, this still begs the question; 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.
I'm not sure you can do that, but you can certainly bind a key to a command that doesn't do anything. For instance you could create a command like this...
Save: Nothing Input: None Output: Discard Key Equivalent: ^J Scope Selector: (leave blank, so it works in all scopes, or enter a scope if you want)
Command(s):
#!/bin/sh exit
Then whenever you hit ^J, it will run this shell script that doesn't do anything. It's not the most elegant thing but it should do what you want, which is to make ^J have no consequence.
Ale's method was using the system keyboard mapping to rebind to items in the menu. But in TextMate specifically, if you create a keybinding in the bundle editor, it will override the bindings in the menus, so you can use this method to override with a new action, or neuter a keybinding as shown above.
Also, you can type ñ with this sequence: Option-n, n
HTH, -dan
Ale's method was using the system keyboard mapping to rebind to items in the menu. But in TextMate specifically, if you create a keybinding in the bundle editor, it will override the bindings in the menus, so you can use this method to override with a new action, or neuter a keybinding as shown above.
Unfortunately, what I actually did was rebind (in OS X in general, using KBE) ^j => move left one character. So it wasn't a bundle binding problem, but rather the fact that TM was using a binding I wanted to be more general. (In general, I bound ^j, ^k, ^l, , ^; to char left, line down, line up, char right.)
Also, you can type ñ with this sequence: Option-n, n
There's approximately 0% chance I'll remember that, but I do appreciate the info. Gawd, I wish I knew some languages other than English.
HTH, -dan
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Jul 31, 2007, at 2:30 PM, Kenneth McDonald wrote:
Also, you can type ñ with this sequence: Option-n, n
There's approximately 0% chance I'll remember that, but I do appreciate the info. Gawd, I wish I knew some languages other than English.
System Preferences -> International -> Input Menu -> Show input menu in menu bar.
From there it is easy to bring up the keyboard viewer to figure out the key binding, or if you just want to insert the character, bring up the character palette and select View: Roman, by Category, Accented Latin.
j.
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…