change Eclipse to use spaces instead of tabs?
程序员文章站
2022-05-01 20:21:13
Java Editor Click Window » Preferences Expand Java » Code Style Click Formatter Click the Edit button Click the Indentation tab Under General Settings ......
java editor
- click window » preferences
- expand java » code style
- click formatter
- click the edit button
- click the indentation tab
- under general settings, set tab policy to:
spaces only
- click ok ad nauseam to apply the changes.
[note: if necessary save profile with a new name as the default profile cannot be overwritten.]
default text editor
before version 3.6:
window->preferences->editors->text editors->insert spaces for tabs
version 3.6 and later:
- click window » preferences
- expand general » editors
- click text editors
- check insert spaces for tabs
- click ok ad nauseam to apply the changes.
note that the default text editor is used as the basis for many non-java editors in eclipse. it's astonishing that this setting wasn't available until 3.3.
c / c++
- click window » preferences
- expand c/c++ » code style
- click formatter
- click the new button to create a new profile, then ok to continue
- click the indentation tab
- under general settings, set tab policy to:
spaces only
- click ok ad nauseam to apply the changes.
html
- click window » preferences
- expand web » html files
- click editor
- under formatting, select the indent using spaces radio button
- click ok to apply the changes.
css
follow the same instructions for html, but select css files instead of html files.
jsp
by default, jsp files follow the formatting preferences for html files.
xml
xml files spacing is configured in preferences.
- click window » preferences
- expand xml » xml files
- click editor
- select indent using spaces
- you can specify the indentation size if needed: number of spaces to inde
上一篇: MySQL数据库高级查询