Over a million developers have joined DZone.

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

· Java Zone

Learn more about the advantages of moving from a monolithic to microservices architecture.  Brought to you in partnership with IBM.

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!

From Idea to Application gives you the architecture to quickly build, manage and run a range of applications (web, mobile, big data, new smart devices, etc.) on an open-standard, cloud-based platform. See why developers are using IBM Bluemix. Brought to you in partnership with IBM.

Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}