Geertjan is a DZone Zone Leader and has posted 453 posts at DZone. You can read more from them at their website. View Full User Profile

Two NetBeans Keyboard Shortcuts That Will Change Your Life (Forever)

05.15.2008
| 20309 views |
  • submit to reddit

These are two NetBeans keyboard shortcuts that, seriously, are very cool. Once you know them magical things will start happening in your life.

Here's the first. Let's say my cursor is within a line, as below, and I get an error message because I don't have a semicolon (because I'm not using Groovy!):

I now press Ctrl-; (i.e., the Ctrl key plus the semicolon key). My cursor is now still in the same place as before, except that I have a semicolon at the end of the line:

Instead of that, if I press Ctrl-Shift-; (i.e., the Ctrl key plus the Shift key plus the semicolon key), from the same position as before, I not only get a semicolon, but the cursor finds itself automatically on the next line, indented according to the previous line's indentation:

Try it... you'll find magical things happening to your life. Like, you'll be coding faster and finishing your projects sooner so that you have more time to contribute tips like this one to NetBeans Zone!

AttachmentSize
step-1.png11.99 KB
step-2.png9.78 KB
step-3.png8.82 KB
Published at DZone with permission of its author, Geertjan Wielenga.

Comments

Eamonn McManus replied on Mon, 2008/05/26 - 12:07pm

I might be missing something, but isn't Ctrl-Shift-; exactly the same as End then ; then CR? And isn't Ctrl-; the same as End then ; except that it leaves you where you are? Sometimes it's hard to know whether the benefit of learning a new key combination is worth the effort of remembering it. :-)

Geertjan Wielenga replied on Mon, 2008/05/26 - 12:28pm in response to: Eamonn McManus

[quote=em109342] except that it leaves you where you are? [/quote]

That's the point. It leaves you where you are. Very handy when you're working on a line of code and you quickly want to add a semicolon without going to the end of the line. Try it.

Carla Brian replied on Wed, 2012/04/04 - 8:05pm

This is kinda interesting. I want to try this one. Thanks for sharing. - Tawny Tucci

Matt Coleman replied on Wed, 2012/06/06 - 12:51am

it is life-changing indeed..ive been using it often graphic design buffalo

Mateo Gomez replied on Thu, 2012/06/07 - 3:57am

this is convenient for most of us...2 shortcuts!!mexican salsa recipes

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.