Assigning Keys to Commands in Subclipse

The Subclipse 1.1.x releases have a new feature that allows you to assign keyboard combinations to various Subclipse commands, such as commit and update. This is an often requested feature by keyboard aficionados. The feature is built on top of the standard mechanism provided in Eclipse for assigning key combinations to commands, so if you are familiar with how that is implemented, that is probably all you need to know to get started. For the rest of us, here is how you assign a key combination to a command.

First, open the Eclipse Preferences using Windows -> Preferences. Then expand the General section of the preferences and click on the Keys preference item. You could also just type Keys in the preference filter on the top of the dialog. You should see a dialog something like this, although in this case the data has already been filled in:






In the category drop-down, you will want to select "SVN". In the Name drop-down, you can then select the SVN command you want to assign a keyboard combination to. You then tab down to the Key Sequence name field. This is where you are going to assign the keyboard combination. To do so, just type the combination you want to use. For example, in the screen shot, I have used Ctrl-Shift-C. The assignments list will show you any existing commands that have been assigned to that combination, as well as the context in which they apply. The final step is to select the context in which you want this combination to be active. The most likely candidate is "In Windows". Once you are done click the Add button and you are done. You can assign more combinations if you want, when you are done just click the OK button to close the preference dialog.

Once the combination has been assigned, you should now see that combination in the Eclipse team menu, or any other place the command you selected appears.



There have been several links to the Eclipse documentation placed within this post. I'd encourage you to read the Eclipse documentation for more information on using this feature.



0 comments: