In Eclipse, I use Ctrl-1 and Ctrl-Space so much that the wear on those three keys is noticeably more than the others.
By default, adding a new (JUnit 4 style) test is a matter of typing "test," then hitting ctrl-space to bring up the appropriate code template. Problem is, Eclipse brings up a number of choices, and hitting enter requires ensuring the right thing is selected (it's not always in first position) and then pressing enter. I've lived with this so far and didn't think much about it until last night, when I created over 50 tests in a 90-minute session, and really resented the overhead.
I edited the template and figured checking the "Auto Insert" box would solve the problem. No dice--Eclipse presents other choices when I type "test," such as one that just inserts the lone @Test annotation. What if I rename the "test" code template to a unique name, like "tst?" No, I get a list with two things--my template, and an option to create a method stub whose name is "tst." No auto insert! I tried a couple other things, such as introducing a special character so that Eclipse would think it couldn't possibly create a method with that name. That didn't work (I don't recall specifically what happened).
I know auto insert works in Eclipse, because I can go into the body of a method, type "sysout" and then press Ctrl-space, and Eclipse auto-completes to "System.out.println()" immediately. It requires no selection on my part. This tells me that auto insert works only if there's one and only one possible selection. Unfortunately, it looks like that will never be the case outside a method but within the class (i.e. where one can create a "Java type member")--any template name could also represent the name for a new method stub.
Keystrokes, then, what about assigning keystrokes? Aha. In the General->Keys preference page, I filtered for "content assist." The choice named simply Content Assist is the one triggered by Ctrl-Space, but another choice is Content Assist (type: Template Proposals), by default assigned no keyboard shortcut. I assigned Ctrl-\ to content assist for template proposals. Now I just type "test" Ctrl-\ and I have my test method stub.
I didn't really want another key combination, mostly because I prefer to go by IDE defaults. My pairing sessions run me through a wide variety of development environments (at last count, within the past year or so, 10 different C++ editors and 3 different Java IDEs), so it's easiest to not create dependencies on my own personal reworking of the key mappings.
Ah well, I suppose there are a few key mappings I'll just have to remember to configure. This is the second one I will want universally for Eclipse; the other is Rerun JUnit Test.
My wish for Eclipse is improved pairing support. The simple idea: you make your key mappings available via a URI. The first time you pair with someone, you add this to Eclipse. From there, a universally defined keystroke allows you toggle through or select from the keymaps.
February 2004 March 2004 May 2004 September 2004 October 2004 January 2005 February 2005 September 2005 October 2005 November 2005 December 2005 January 2006 February 2006 March 2006 June 2006 August 2006 January 2007 February 2007 March 2007 April 2007 September 2007 October 2007 November 2007 December 2007 January 2008 February 2008 March 2008 April 2008 May 2008 June 2008 July 2008 August 2008 September 2008 October 2008 November 2008 December 2008 January 2009 February 2009 March 2009 April 2009 June 2009 August 2009 December 2009 January 2010