views:

2233

answers:

6

In eclipse you can click Ctrl+I at any line, and it'll automatically indent the line or group of lines according to the indentation scheme you chose in the settings.

I'm really missing this feature in Netbeans. Is there any equivalent feature?

I'm aware of Alt+Shift+F but it's not good enough. I want to indent a group of lines, and not all the file.

A: 

ctl-shift-f will do a format of all the code in the page.

Milhous
In the latest Netbeans (6.71) it's Alt+Shift+F and it doesn't work in javaFX mode. Eclipse CDT (for C/C++) has it working. It's still not good enough, as I sometimes want to indent only a few lines, and not all the code (for instance when fixing small portions of big file with bad identation. I don't want to change the indentation of all lines)
Elazar Leibovich
+2  A: 

Open Tools -> Options -> Keymap, then look for the action called "Re-indent current line or selection" and set whatever shortcut you want.

Radek Vařbuchta
Still doesn't work with JavaFX, but eclipse JavaFX plugin have this defect as well, so I guess I just have to wait for JavaFX to mature. Thanks!
Elazar Leibovich
+1  A: 

Shift + Alt + F indents the whole file.

Ensode
See my reply to @Milhous
Elazar Leibovich
+2  A: 

Select the lines you want to reformat (indenting), then hit Alt+Shift+F. Only the selected lines will be reformatted.

OliBlogger
A: 

thanks i never was aware of this ALT+SHIFT+F function, lol i been indenting manually for a long time.........hahaha aw well, now i know

ANdey
A: 

thanks a lot guys...

vignesh