问题
I swear I looked everywhere, and disabled almost everything (insertion of matching brackets etc), but when I type an opening brace and hit enter, it auto-indents the next line with a tab. Is there a way to disable this "handy" "commodity"?
回答1:
- From the menu go to Project > Properties
- Select Java Code Style > Formatter
- Check the box for Enable project specific settings OR click Configure Workspace Settings
- Click the Edit... button for the active profile
- On the Indentation tab uncheck all of the Indent options
回答2:
White Fang gave you the correct answer, but I will give you a guide how to find options that you need:
- Open Window > Preferences (or Project > Properties)
- Type the word you need in the search box.
The search in settings is extremely useful. When you type "indent", it would filter the irrelevant items in the tree.
回答3:
The right thing to do here is to disable smart insert mode completely (Edit > Smart Insert Mode), or configure the Smart Insert Mode (Windows > Preferences > Java > Editor > Typing).
来源:https://stackoverflow.com/questions/5769957/how-do-i-disable-auto-indent-in-eclipse-helios-java