How do I autoindent in Netbeans?

后端 未结 10 1198
挽巷
挽巷 2020-12-02 05:25

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 i

相关标签:
10条回答
  • 2020-12-02 05:43

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

    0 讨论(0)
  • 2020-12-02 05:43

    Here's the complete procedure to auto-indent a file with Netbeans 8.

    First step is to go to Tools -> Options and click on Editor button and Formatting tab as it is shown on the following image.

    enter image description here

    When you have set your formatting options, click the Apply button and OK. Note that my example is with C++ language, but this also apply for Java as well.

    The second step is to CTRL + A on the file where you want to apply your new formatting setting. Then, ALT + SHIFT + F or click on the menu Source -> Format.

    Hope this will help.

    0 讨论(0)
  • 2020-12-02 05:44

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

    0 讨论(0)
  • 2020-12-02 05:44

    for Java NetBeans 7.1 and later, even in NetBeans 8.0 (That i´m currently using) and later, the shortcut is:

    Alt+Shift+F

    if you look into the KeyMap accessing from the menu: Tools -> Options -> Keymap, the "action" is Format defined with the Shortcut : Alt+Shift+F

    0 讨论(0)
  • 2020-12-02 05:51

    To format all the code in NetBeans, press Alt + Shift + F. If you want to indent lines, select the lines and press Alt + Shift + right arrow key, and to unindent, press Alt + Shift + left arrow key.

    0 讨论(0)
  • 2020-12-02 05:54

    Ctrl+Shift+F will do a format of all the code in the page.

    0 讨论(0)
提交回复
热议问题