Keyboard Shortcuts I Use All the Time

There's a couple of keyboard shortcuts I use all the time in NetBeans. Some of them might not be completely obvious, so maybe you can discover some useful timesavers here (I skip the most obvious ones like Ctrl-S or Ctrl-C). They save time because I don't have to switch my right hand to the mouse. Btw, I don't mostly use them in demos because it's better to use menus (shortcuts are not visible and thus would be magical), but in real life they're really handy:

Ctrl-E: deletes current line - very useful when deleting code :)
Alt-Enter: invokes the editor hint - you have to be on the line which is underlined with error mark so that this works(!)
Alt-Shift-F: fixes imports, faster than hints and knows how to resolve conflicts
Ctrl-Shift-F: reformats code, useful e.g. when cut & pasting code which is not properly formatted
Alt-Shift-O: open an arbitrary class, very fast, doesn't depend on package
Alt-left/right arrow: move to the class in the left/right opened editor
Ctrl-A: select all, works in all kinds of dialogs
Ctrl-1,2,3: move to projects/files/favorites
Ctrl-7, text: move to navigator and quick search for any method/field, enter to jump
Ctrl-mouse-click: navigate to the definition of any element in the source code (works also outside java code)
Ctrl-left/right arrow: jump one word left or right
Ctrl-G: go to line
Ctrl-K: code completion for losers
Ctrl-Space: if you don't know this one go shoot yourself :)
Alt-F4: time to go to sleep :)

Do you use any other ones which are convenient to get used to?

"Ctrl-K: code completion for losers"

Hey! I resemble that remark! :-)

Posted by Gregg Sporar on červen 26, 2006 at 04:26 odp. CEST #

Ctrl-Shift-T/D: comment/uncomment selected code (or current line) very useful :)

Posted by Nicolas Désy on červen 26, 2006 at 08:06 odp. CEST #

> Ctrl-Shift-F: reformats code, useful e.g. when cut & pasting code which is not properly formatted

I find Ctrl+Shift+V quite useful when pasting as the new code gets automatically formatted..


Posted by Dmitri Trembovetski on červen 27, 2006 at 12:40 dop. CEST #

Ctrl+Shift+V doesn't reformat the code correctly. Try pasting code with a comment inside.

Posted by Kovica on červen 27, 2006 at 02:10 dop. CEST #

Ctrl-4 - Switching to the output window Ctrl-0 - Switching to the editor Alt-Up/Down - Copy Line up or down (only available if the LineTools by Sandip ( are installed) Ctrl-Alt-Left/Right - next Camelcase word (only available by Sandip's tools) - with additional Shift it becomes marked Alt-K/L Forward/backward to the last, next position the cursor where. All the bookmark keys. That's a really cool feature @Roumen 1: the Alt-Left/right works in all parts of the IDE, e.g. you can switch from projects tab to files tab if they are located next to each other @Roumen 2: Why is Ctrl-K for losers? It's with large classes and a large code base, the much faster alternative to the normal code completion. Greetz J..e

Posted by Jake on červen 27, 2006 at 03:07 dop. CEST #

Ctrl-Shift-F6 : Unit test results window

Posted by Eddy Young on červen 27, 2006 at 04:28 dop. CEST #

How about Ctrl-Z? :)

Posted by Khanh Quoc Ngoc Le on červen 27, 2006 at 05:34 dop. CEST #

hehehehehe Ctrl-Y too

Posted by Eduardo on červen 27, 2006 at 06:31 dop. CEST #

Ctrl-Y too... :)

Posted by Eduardo on červen 27, 2006 at 06:31 dop. CEST #

Ctrl-K for losers... it's kind of a "cheap" code completion, nothing really against it... ;)

Posted by Roumen on červen 27, 2006 at 07:48 dop. CEST #

Some basic ones: Ctrl-F4/Ctrl-W: I really hate to have a lot of opened windows Alt-O: Just like Ctrl-click Ctrl-F/Ctrl-H: Let's search and destroy (replace, indeed)

Posted by Eduardo Costa on červen 27, 2006 at 12:26 odp. CEST #

F9 - lets you see your Netbeans Windows + jconsole + your app + other windows all at once. Mac only.

Posted by Adrian Milliner on červen 27, 2006 at 04:37 odp. CEST #

Control F - has been a timesaver for FINDING details in Long paged documents - works, even on WEBpages CONTROL H - Find and Replace - has been a time saver for many types of document Editing and on the WEB it brings up the HISTORY to search for previous URLs although, not technically a shortcut - RightClicking on any link and selecting the "open (link) in new window" option for the context menu - is extremely useful for power searchers

Posted by Search Engines WEB on červen 27, 2006 at 05:56 odp. CEST #

Ctrl-C/Ctrl-V :)

Posted by anybridge on červen 28, 2006 at 02:57 dop. CEST #

Are you a "cut&paste" programmer? :))

Posted by Roumen on červen 28, 2006 at 03:00 dop. CEST #

These are all very useful, but part of the overhead of essentially moving from one text editor to another. Is there an easy way to set everything up in, say, VIm compatibility mode? It's too bad no good VIm/[text editor of your choice] extension of Swing components exists yet (that I know of, anyway).

Posted by rufwork on červen 29, 2006 at 08:33 dop. CEST #

There are Emacs and Eclipse shortcuts available in NetBeans 5.5 but that won't satisfy you, I guess... anyone from community can create the shortcuts profile for vi and contribute it, it may then become part of the release :)

Posted by Roumen on červen 29, 2006 at 08:36 dop. CEST #

Post a Comment:
Comments are closed for this entry.

Roman Strobl


« červen 2016