4

Can I configure netbans or is there a keyboard shortcut for adding a semicolumn automatically?

Currently, with the of the box behaviour, when I type-in the following;

die("x

Netbans automatically turns that into the following;

die("x|")

Please note that in the above demonstration, the | denotes the blinking cursor location)

Now...

At this time, wouldn't it be nice to go to the next line by hitting the [enter] key with some key combination and you end up with this?

die("x");
|
4
  • In Java, at least, not every line will end with a semicolon ... so ... why would you want to do this?
    – scottb
    Commented Oct 12, 2013 at 15:19
  • shoot! I forgot to contextualize it under PHP. I program in PHP only. sorry abut that. I will add the PHP tag into the question. Commented Oct 12, 2013 at 20:35
  • Is pressing <End> ; <Enter> too hard?
    – Cole Tobin
    Commented Oct 12, 2013 at 20:36
  • 1
    sometimes it becomes hard. when you switch keyboards and the laptop manuafacturer puts the end key to all kind of far away & unfamiliar places, sure it gets a little annoying. If you had a choice to set that up, would not CTRL ENTER be easier? Or would you still prefer hunting down that end key? Commented Oct 13, 2013 at 17:29

1 Answer 1

5

For NetBeans (Java EE bundle at least) is Ctrl-Shift-;. (Ctrl-; for adding ; without new line). I've tested in NB 7.4 with a PHP file and it worked.

Ctrl-Shift-; press simultaneously Control Shift and the semicolon key (not Control and dash)

https://i.sstatic.net/atu6Q.png

4
  • ctrl - does not do anything for me. pressing just the dash obviously inserts the dash where the cursor is. However, pressing ctrl & dash at the same time prints inserts nothing. Cursor continues to blink where it is. ctrol shift also does not do anything. Commented Oct 21, 2013 at 17:08
  • Ctrl and shift and semicolon, not control and dash. Commented Oct 23, 2013 at 12:31
  • thank you for the ultimate nailer. would you recommend me a site you like that gives you great netbeans tips? For example, so far, I'm unable to figure out how to display the open files list in a vertical format instead of the current look of the horizontal. When there are say, 9 files, some are unfortunately out of view. I've been doing ctrl-tab to get the open files list in a vertical format... but direct access ( one link approach P) would be superior... looking for solutions for things like that... how do we find solutions to these... netbeans forum does not seem to be that responsive... Commented Oct 24, 2013 at 17:34
  • Get a bigger screen :) . Try Shift-F4 and Alt-Shift-O. (Personally I don't like to customize programs - and programs that need to be customized) Commented Nov 4, 2013 at 21:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.