Thursday, December 18, 2008

Custom Shortcuts in Eclipse

In the past I've posted on my favorite built-in key-bindings.  But with Eclipse you can actually bind any key combination to any 'command' using the eclipse platform command framework.

Here are some of the custom ones I like to set:
control + ; => next view
control + shift + ; => previous view

control + alt + W => close view

control + tab => next editor
control + shift + tab => previous editor

control + O in Task View => Open Remote Task

control + shift + ?

Editing Templates

You can also write a plugin to offer your own commands and templates.  Here are a couple I've written in the past.  If I'm feeling adventurous one day, I'll try to get back to this post and update it with the details.

Creating a Custom Template

sysout proposal for selected text (wrap the selected string in a System.out.println() ).

Creating a Custom Command

control+alt+L hack => goto line and select it

Previously, this required 3 separate actions:
Goto Line
End => goto line end
Shift + Home => highlight to line beginning
Post a Comment