NetBeans 6.0: Making Me a KeyBoard Junkie

I was recently at a conference giving a demo for the new NetBeans 6.0 editor features.  In preparing for the demo and actually doing it,  I realized that reducing keystrokes is huge for developers.  I've been so accustomed to broken IDEs where I had to cursor and mouse around that I didn't realize how much NetBeans 6.0 editing has improved until I was in the middle of this demo.  I actually got a rush hitting the "Enter" key and seeing smart code completion save me lots of keystrokes.  I'm becoming a keyboard junkie (no sneering from the emacs crowd) so now I'm looking for more keystroke saving key bindings.  A great resource to get started on Java editor enhancments in NetBeans 6.0 is the Java Editor User's Guide on the NetBeans public Wiki.  Two keystroke and mouse saving features I recently found useful are AST (Abstract Syntax Tree) selection and Next/Previous Tab.

The AST (Abstract Syntax Tree) keymap is listed in the "Tools->Options" (Preferences on Mac OS X) under the "Keymap" heading.  The actual setting is "Other->Select Next Element/Select Previous Element".  This lets you select things like a keyword, a line, and a block of code.  The default key mapping is "Alt-Shift-PERIOD" (Ctrl-Shift-PERIOD on Mac OS X) to select more and "Alt-Shift-COMMA" (Ctrl-Shift-COMMA on Mac OS X) to select less.

I found out about Next/Previous Tab in Gregg Sporar's blog.  But I couldn't get this to work so I did some investigation.  On Mac OS X the default key binding to do a Next Tab is "Meta-PAGE_DOWN".  To get this to work you need to press "Meta-Fn-PAGE".  Pressing three keys at once really doesn't save me much so I remapped this to "Meta-DOWN" and "Meta-UP".  Note that you will have to "Remove" these key mappings from the "Other->Insertion Point to End of Document" and "Other->Insertion Point to Beginning of Document".

mapping1


Above all, trying hitting the "Enter" key when you're doing code completion and you'll be amazed at just how smart the code completion really is.  Happy keyboarding!


Comments:

Cheers Dave,
I really wanted to know how to select a line of text and google brought me to you.

Posted by Liam on November 19, 2007 at 09:41 AM MST #

With NB 6.0 and OS X 10.4 I'm finding that auto popup is quite flaky for code completion - most of the time I have to press CTRL-space. Is there some secret trick to getting this to work as advertised?

Posted by antirealist on December 04, 2007 at 02:53 PM MST #

antirealist,

Sorry but could you elaborate on "as advertised"? CTRL-space invokes the code completion window. Of course another trigger is ".". So you can always type "this." to invoke code completion for items within the scope of the current class. Of course you don't get the "smart" code completion.

Posted by David on December 04, 2007 at 04:34 PM MST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

David Botterill

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today