views:

286

answers:

4

In Netbeans I find keyboard shortcuts that deal with the current line of code very helpful, like Ctrl-Shift-Down: duplicate Shift-Alt-Down: move Ctrl-E: delete

Is there a shortcut for selecting, cutting or copying the current line of code? I've looked through many cheat sheets and thought I'll ask here before attempting a macro.

Thanks!

A: 

heh he. I've always used home, shift-end, ^C, since it works in just about every editor there is.

Thank you! but on my current keyboard layout the Home and End keys are Fn-Home and Fn-End. This translates to 7 complicated key presses on my system. Not exactly a SHORT cut.
JannieT
I've remapped a couple keys on my keyboard for the sake of sanity. (I'm a frequent vi user, so I've remapped capslock to be escape, in place of the crappy calculator-button-style escape key I have on my keyboard.) You could do a little poking around to find out what the keycodes for the Fn-Etc keys are and map them to proper home and end keys.
A: 

I found you could easily assign a keyboard shortcut for selecting the current line in the Keymap section of the Netbeans Options. I've now mapped Ctrl+. to do this.

JannieT
A: 

NetBeans supports editor macros.

  • Open a document.

  • Click in it to set an initial cursor position.

  • Click "Edit > Start Macro Recording".

  • Press Home, press Shift-End, press Ctrl-C.

  • Click "Edit > Stop Macro Recording".

  • You will now be prompted to name your macro. Use something obvious like select-entire-line.

  • Click OK
  • Click Set Shortcut... to assign a shortcut to the macro.
Devon_C_Miller
A: 

Tripple click anywhere on that line. Then press Ctrl-C.

Paul
Thanks! I didn't know that. I was specifically looking for a keyboard shortcut though. Don't like my mouse so much when coding.
JannieT