Freedom, Community & Sustainability

Netbeans shortcuts that will dramatically improve your productivity

October 15, 2014 -- William
Last modified on August 2016
Duration: 5 minutes or less

I'll keep this list short to bring you only the most useful shortcuts Netbeans offers. If you forget them you can always come back to this page or refer to netbeans shortcuts at Tools > Options > Keymap. Note that you can also modify or create your own shortcuts on the keymap config.

If you were looking for an extensive cheat sheet, download the official shortcuts and auto-completion cheat sheet in PDF format.


Ctrl + Space toggle code helper (autocomplete)
Ctrl + / toggle comments on current line(s) (also Ctrl + Shift + C)
Ctrl + ; adds a semi-colon to the end of the line without moving the cursor
Ctrl + Shift + ; adds a semi-colon to the end of the line and moves cursor to new line
Shift + Enter starts a blank new line (without breaking at cursor position)
Alt + Shift + F indents selected code or indent entire file if nothing selected
Ctrl + E deletes entire line
Ctrl + BackSpace deletes previous word
Ctrl + Del deletes next word

If you use Netbeans often you should probably learn these shortcuts by heart, it's not only about saving a little bit of time every time you use them, it's about keeping your mind concentrated on coding rather than text editing. Having a nice and fluid workflow can make a big difference!

Other useful tips to save time and effort

To duplicate a file (say you want to keep a fresh copy of a file and use one to test) you can select from the file browser the file you want to duplicate, then right-click and select copy, then go to the source files folder, right-click and select paste. The point is that you don't need to open the file, select all text, copy text, create a new file, paste the text and save.

There are many plugins that can be installed on Tools > Plugins. Among them you can install Php manual search. This plugin adds a PHP button on top of Netbeans and searches the official PHP manual for whatever your cursor is on. It's a neat way to quickly open php.net on the apropriate page.

Let me know if you have other useful tips and tricks to improve productivity!

Add new comment