Is it possible to re-bind Cmd+J and Shift+Cmd+J? Or are they consumed by the menu system? I was unable to locate the appropriate command TextMate uses for these keys.
Also, is there a complete list of commands TextMate supports for key bindings. The default KeyBindings.dict does not list everything (e.g., movePageUp, movePageDown).
Thanks.
Brendan Dixon brendandixon@mac.com 425.922.8798
On Jan 3, 2007, at 2:22 PM, Brendan Dixon wrote:
Is it possible to re-bind Cmd+J and Shift+Cmd+J? Or are they consumed by the menu system? I was unable to locate the appropriate command TextMate uses for these keys.
Edit -> Find -> Jump to Selection Navigation -> Go to Middle Visible Line
Creating a new textmate command and assigning it one of these key equivalents seems to work for me, in terms of overriding them. Unless I've misunderstood what you are trying to do.
Also, is there a complete list of commands TextMate supports for key bindings. The default KeyBindings.dict does not list everything (e.g., movePageUp, movePageDown).
It probably supports some subset of these: http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/Classes/NSResponder_Class/Reference/Reference.html#// apple_ref/occ/cl/NSResponder plus perhaps some of Allan's own. But at that point, without Allan publishing an API, it's unclear what will and will not work, especially in the long run.
Thanks.
Brendan Dixon brendandixon@mac.com 425.922.8798
Haris
I was hoping to use key bindings. I suppose I could create a TextMate command...but won't that confuse how TextMate binds/handles keystrokes?
Brendan Dixon brendandixon@mac.com 425.922.8798
On Jan 3, 2007, at 12:04 PM, Charilaos Skiadas wrote:
On Jan 3, 2007, at 2:22 PM, Brendan Dixon wrote:
Is it possible to re-bind Cmd+J and Shift+Cmd+J? Or are they consumed by the menu system? I was unable to locate the appropriate command TextMate uses for these keys.
Edit -> Find -> Jump to Selection Navigation -> Go to Middle Visible Line
Creating a new textmate command and assigning it one of these key equivalents seems to work for me, in terms of overriding them. Unless I've misunderstood what you are trying to do.
Also, is there a complete list of commands TextMate supports for key bindings. The default KeyBindings.dict does not list everything (e.g., movePageUp, movePageDown).
It probably supports some subset of these: http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/Classes/NSResponder_Class/Reference/Reference.html#// apple_ref/occ/cl/NSResponder plus perhaps some of Allan's own. But at that point, without Allan publishing an API, it's unclear what will and will not work, especially in the long run.
Thanks.
Brendan Dixon brendandixon@mac.com 425.922.8798
Haris
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 Jan 3, 2007, at 3:07 PM, Brendan Dixon wrote:
I was hoping to use key bindings. I suppose I could create a TextMate command...but won't that confuse how TextMate binds/ handles keystrokes?
We still don't know what you are trying to do. Are you trying to bind these two commands to different keys, or are you trying to use those keys for a different command? I'm afraid your original post does not make that clear, at least not to me.
One thing you can try and do is record a macro performing this operation you want and then save the macro. Then open the macro file for editing in textmate or even just look at the macro in the bundle editor. Doing that with the Jump To Selection item gave me the command "centerSelectionInVisibleArea", while doing it for the second one gave "centerCaretInDisplay".
Hope this helps
Brendan Dixon brendandixon@mac.com 425.922.8798
Haris
Hmm, I'll try to be more clear.
I've followed Allen's instructions to change key-to-command associations by editing KeyBindings.dict as he explains in several posts and his blog. Most of these are straightforward since I know the command name to use (e.g., movePageUp:, scrollPageDown:). However, I cannot find the command names associated with the Shift+Cmd +J and Cmd+J bindings. Further, Shift+Cmd+J is listed as a keyboard shortcut for a menu item which, if I've understood Allen, complicates matters because the menu system consumes keystrokes before sending them on to the application.
What I'd like to do is switch the meanings of Shift+Cmd+J and Cmd+J. I had hoped that I could accomplish the switch my editing, as I have for other key-to-command associations, the KeyBindings.dict file (either directly or by means of the KeyBindingsEditor application and referenced in one or more posts).
Does this help? If changing the key bindings will not work, does anyone have a suggestion on how I might switch the meanings of these keystroke sequences?
Brendan Dixon brendandixon@mac.com 425.922.8798
On Jan 3, 2007, at 12:22 PM, Charilaos Skiadas wrote:
On Jan 3, 2007, at 3:07 PM, Brendan Dixon wrote:
I was hoping to use key bindings. I suppose I could create a TextMate command...but won't that confuse how TextMate binds/ handles keystrokes?
We still don't know what you are trying to do. Are you trying to bind these two commands to different keys, or are you trying to use those keys for a different command? I'm afraid your original post does not make that clear, at least not to me.
One thing you can try and do is record a macro performing this operation you want and then save the macro. Then open the macro file for editing in textmate or even just look at the macro in the bundle editor. Doing that with the Jump To Selection item gave me the command "centerSelectionInVisibleArea", while doing it for the second one gave "centerCaretInDisplay".
Hope this helps
Brendan Dixon brendandixon@mac.com 425.922.8798
Haris
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 Jan 3, 2007, at 3:57 PM, Brendan Dixon wrote:
Does this help? If changing the key bindings will not work, does anyone have a suggestion on how I might switch the meanings of these keystroke sequences?
Did you try with the two command names I mentioned below? Those are the names for the two commands you called, you should be able to directly assign them to keys via the keybindings mechanism, just like you've done for the other commands like movePageUp, or like you could do for probably most of the actions listed in the link I posted.
In other words, binding centerSelectionInVisibleArea and centerCaretInDisplay should do what you want.
On Jan 3, 2007, at 12:22 PM, Charilaos Skiadas wrote:
One thing you can try and do is record a macro performing this operation you want and then save the macro. Then open the macro file for editing in textmate or even just look at the macro in the bundle editor. Doing that with the Jump To Selection item gave me the command "centerSelectionInVisibleArea", while doing it for the second one gave "centerCaretInDisplay".
Haris
I'll try these. These are the command names I was looking for.
Brendan Dixon brendandixon@mac.com 425.922.8798
On Jan 3, 2007, at 1:02 PM, Charilaos Skiadas wrote:
On Jan 3, 2007, at 3:57 PM, Brendan Dixon wrote:
Does this help? If changing the key bindings will not work, does anyone have a suggestion on how I might switch the meanings of these keystroke sequences?
Did you try with the two command names I mentioned below? Those are the names for the two commands you called, you should be able to directly assign them to keys via the keybindings mechanism, just like you've done for the other commands like movePageUp, or like you could do for probably most of the actions listed in the link I posted.
In other words, binding centerSelectionInVisibleArea and centerCaretInDisplay should do what you want.
On Jan 3, 2007, at 12:22 PM, Charilaos Skiadas wrote:
One thing you can try and do is record a macro performing this operation you want and then save the macro. Then open the macro file for editing in textmate or even just look at the macro in the bundle editor. Doing that with the Jump To Selection item gave me the command "centerSelectionInVisibleArea", while doing it for the second one gave "centerCaretInDisplay".
Haris
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 03.01.2007, at 21:57, Brendan Dixon wrote:
Hmm, I'll try to be more clear.
I've followed Allen's instructions to change key-to-command associations by editing KeyBindings.dict as he explains in several posts and his blog. Most of these are straightforward since I know the command name to use (e.g., movePageUp:, scrollPageDown:). However, I cannot find the command names associated with the Shift +Cmd+J and Cmd+J bindings. Further, Shift+Cmd+J is listed as a keyboard shortcut for a menu item which, if I've understood Allen, complicates matters because the menu system consumes keystrokes before sending them on to the application.
What I'd like to do is switch the meanings of Shift+Cmd+J and Cmd +J. I had hoped that I could accomplish the switch my editing, as I have for other key-to-command associations, the KeyBindings.dict file (either directly or by means of the KeyBindingsEditor application and referenced in one or more posts).
Does this help? If changing the key bindings will not work, does anyone have a suggestion on how I might switch the meanings of these keystroke sequences?
Brendan Dixon brendandixon@mac.com 425.922.8798
You can change standard menu bindings via System Preferences → Keyboard & Mouse. Have you tried this? I have overridden a different menu shortcut in iTunes that way, so it seems the binding in System Preferences gets precedence.
Soryu.
Brendan Dixon wrote:
Is it possible to re-bind Cmd+J and Shift+Cmd+J? Or are they consumed by the menu system? I was unable to locate the appropriate command TextMate uses for these keys.
Also, is there a complete list of commands TextMate supports for key bindings. The default KeyBindings.dict does not list everything (e.g., movePageUp, movePageDown).
No, but you can find them in 2 places. First, you can look at my [complete list][list] of generic selectors, but you can look in the key bindings file inside the TM app to see what the extra ones are.
To override ⌘J and ⇧⌘J you can't use bindings, because the ⌘ key is always sucked up by the menus, so instead, in TextMate, you can make a macro that does the desired action, and then set it to have the desired key equivalent.
[list]: http://www.hcs.harvard.edu/~jrus/site/selectors.html
-Jacob