|Overriding key bindings for editing text [message #1039960]
||Fri, 12 April 2013 21:40
| Thomas Wheeler
Registered: April 2013
I'm trying to create custom key bindings for text editors (Juno and Kepler). After a bit of experimenting I still don't understand what Eclipse is doing. |
Here are the bindings I want:
Line Down -> Ctrl+B
Line Up -> Ctrl+G
Line Begin -> Ctrl+R
Line End -> Ctrl+T
1. Apparently Ctrl+T is bound to "Quick Hierarchy" when Editing Java Source. However, none of the bindings for Ctrl+T that I can find are for "Editing Java Source". If I filter on "Quick Hierarchy" I see the command, but there is no binding or context. How do I find the Ctrl+T binding for Editing Java Source?
2. Defining a second override for Ctrl+T, for Editing Java Source, worked.
3. I'm unable to find an override for Ctrl+T that works when editing an Ant file. I see the same behavior when trying to rebind Ctrl+G and Ctrl+B bindings. I also tried overriding both Editing Ant Buildfiles and Editing XML Source, with no success.
4. The same bindings work fine when editing context.xml.
I suspect my mental model of how bindings should work is badly broken. It "seems" like an override for Editing Text should apply to all text editors regardless of the type of file open in the editor. Obviously that isn't the case, but I can't construct a coherent mental model that explains what it's doing in these four separate cases. My solution at the moment is "try overriding in a context that seems to apply, and if that doesn't work add more overrides to other contexts in hopes that you get lucky".
To end with a specific questions, is there a way to get a binding for Edit Text to work for all editors, regardless of file type? (I.e. override all contexts.)
Powered by FUDForum
. Page generated in 0.02070 seconds