How do I autoindent in Netbeans?

后端 未结 10 1253
挽巷
挽巷 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:57

    If you want auto-indent just like Emacs does it on TAB, i.e. indent the current line and move the cursor to the first non-whitespace character, do this:

    1. Go to Tools -> Options -> Editor -> Macros
    2. Create a new macro and call it something like "tabindent"
    3. Insert the following macro code:

      reindent-line caret-line-first-column caret-begin-line

    4. Click "Set Shortcut" and press TAB

提交回复
热议问题